Skip to content

Commit 15fcc32

Browse files
committed
Fix edge case where shell_exec doesn't return a string
1 parent 417a3c3 commit 15fcc32

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Context/FeatureContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ private static function terminate_proc( $master_pid ): void {
762762

763763
$output = shell_exec( "ps -o ppid,pid,command | grep $master_pid" );
764764

765-
foreach ( explode( PHP_EOL, $output ) as $line ) {
765+
foreach ( explode( PHP_EOL, $output ? $output : '' ) as $line ) {
766766
if ( preg_match( '/^\s*(\d+)\s+(\d+)/', $line, $matches ) ) {
767767
$parent = $matches[1];
768768
$child = $matches[2];

0 commit comments

Comments
 (0)