Skip to content

Commit 0b29a70

Browse files
committed
fix: warning about trim function use
1 parent 849eaee commit 0b29a70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/stacks.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,8 @@ function slic_stacks_read_ports_from_docker($stack_id) {
640640

641641
// Check if containers are actually running
642642
$check_command = "docker ps -q -f label=com.docker.compose.project='$project_name' 2>/dev/null";
643-
$container_ids = trim(shell_exec($check_command));
643+
$check_command_output = shell_exec( $check_command );
644+
$container_ids = $check_command_output ? trim( $check_command_output ) : '';
644645

645646
if (empty($container_ids)) {
646647
// Containers not running

0 commit comments

Comments
 (0)