From dc97d6b3764df001bc79b366ab44088fa9b0e5b9 Mon Sep 17 00:00:00 2001 From: Jens Prangenberg Date: Fri, 20 Sep 2024 08:34:01 +0200 Subject: [PATCH] Handle null errors in Action model instantiation Previously, the `error` property could be undefined, leading to potential issues during object creation. This update ensures that `error` defaults to `null` if not provided, enhancing the robustness of the Action model instantiation process. --- src/Models/Actions/Action.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Models/Actions/Action.php b/src/Models/Actions/Action.php index 0b206f7..67c1ebb 100644 --- a/src/Models/Actions/Action.php +++ b/src/Models/Actions/Action.php @@ -148,6 +148,6 @@ public static function parse($input) return; } - return new self($input->id, $input->command, $input->progress, $input->status, $input->started, $input->finished, $input->resources, $input->error); + return new self($input->id, $input->command, $input->progress, $input->status, $input->started, $input->finished, $input->resources, $input->error ?? null); } }