Skip to content

Commit 625b9ee

Browse files
authored
Merge pull request #8 from laravel-workflow/feature/laravel-serializable-closures
Fix null output
2 parents 7bf72e5 + d77da7e commit 625b9ee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/Http/Controllers/WorkflowsController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,17 @@ public function show($id) {
5151
$file->next();
5252
if ($file->eof()) break;
5353
}
54-
$exception->code = rtrim($exception->code);
55-
$unserialized->trace = $unserialized->getTrace();
54+
$exception->code = rtrim($exception->code);
55+
try {
56+
$unserialized->trace = $unserialized->getTrace();
57+
} catch (\Throwable $th) {
58+
}
5659
}
5760
$exception->exception = serialize($unserialized);
5861
return $exception;
5962
});
6063

61-
$flow->output = serialize(Y::unserialize($flow->output));
64+
$flow->output = $flow->output === null ? serialize(null) : serialize(Y::unserialize($flow->output));
6265

6366
return $flow;
6467
}

0 commit comments

Comments
 (0)