diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index f5acf281be..4d27ea2775 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -2348,7 +2348,7 @@ void Shell::kill_job(Job const* job, int sig) } } -void Shell::save_to(JsonObject& object) +ErrorOr Shell::save_to(JsonObject& object) { Core::Object::save_to(object); object.set("working_directory", cwd); @@ -2367,9 +2367,11 @@ void Shell::save_to(JsonObject& object) job_object.set("running_time", job_entry.value->timer().elapsed()); job_object.set("command", job_entry.value->cmd()); job_object.set("is_running_in_background", job_entry.value->is_running_in_background()); - job_objects.must_append(move(job_object)); + TRY(job_objects.append(move(job_object))); } object.set("jobs", move(job_objects)); + + return {}; } void Shell::possibly_print_error() const diff --git a/Userland/Shell/Shell.h b/Userland/Shell/Shell.h index f8ca97cbbd..8f4872f05d 100644 --- a/Userland/Shell/Shell.h +++ b/Userland/Shell/Shell.h @@ -402,7 +402,7 @@ private: bool is_allowed_to_modify_termios(const AST::Command&) const; // FIXME: Port to Core::Property - void save_to(JsonObject&); + ErrorOr save_to(JsonObject&); void bring_cursor_to_beginning_of_a_line() const; Optional resolve_job_spec(StringView);