Skip to content

Commit c7c2924

Browse files
committed
fix: Update remoteProcess.php to handle null values in logItem properties
1 parent aa30e83 commit c7c2924

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

bootstrap/helpers/remoteProcess.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,35 +371,35 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d
371371
return $i;
372372
})
373373
->reduce(function ($deploymentLogLines, $logItem) use ($seenCommands) {
374-
$command = $logItem['command'];
375-
$isStderr = $logItem['type'] === 'stderr';
374+
$command = data_get($logItem, 'command');
375+
$isStderr = data_get($logItem, 'type') === 'stderr';
376376
$isNewCommand = ! is_null($command) && ! $seenCommands->first(function ($seenCommand) use ($logItem) {
377-
return $seenCommand['command'] === $logItem['command'] && $seenCommand['batch'] === $logItem['batch'];
377+
return data_get($seenCommand, 'command') === data_get($logItem, 'command') && data_get($seenCommand, 'batch') === data_get($logItem, 'batch');
378378
});
379379

380380
if ($isNewCommand) {
381381
$deploymentLogLines->push([
382382
'line' => $command,
383-
'timestamp' => $logItem['timestamp'],
383+
'timestamp' => data_get($logItem, 'timestamp'),
384384
'stderr' => $isStderr,
385-
'hidden' => $logItem['hidden'],
385+
'hidden' => data_get($logItem, 'hidden'),
386386
'command' => true,
387387
]);
388388

389389
$seenCommands->push([
390390
'command' => $command,
391-
'batch' => $logItem['batch'],
391+
'batch' => data_get($logItem, 'batch'),
392392
]);
393393
}
394394

395-
$lines = explode(PHP_EOL, $logItem['output']);
395+
$lines = explode(PHP_EOL, data_get($logItem, 'output'));
396396

397397
foreach ($lines as $line) {
398398
$deploymentLogLines->push([
399399
'line' => $line,
400-
'timestamp' => $logItem['timestamp'],
400+
'timestamp' => data_get($logItem, 'timestamp'),
401401
'stderr' => $isStderr,
402-
'hidden' => $logItem['hidden'],
402+
'hidden' => data_get($logItem, 'hidden'),
403403
]);
404404
}
405405

0 commit comments

Comments
 (0)