diff --git a/Userland/Utilities/utmpupdate.cpp b/Userland/Utilities/utmpupdate.cpp index c055559b7e..cb18839f7b 100644 --- a/Userland/Utilities/utmpupdate.cpp +++ b/Userland/Utilities/utmpupdate.cpp @@ -80,10 +80,12 @@ int main(int argc, char** argv) JsonObject json; - if (!previous_json.has_value() || !previous_json.value().is_object()) { - dbgln("Error: Could not parse JSON"); - } else { - json = previous_json.value().as_object(); + if (!file_contents.is_empty()) { + if (!previous_json.has_value() || !previous_json.value().is_object()) { + dbgln("Error: Could not parse JSON"); + } else { + json = previous_json.value().as_object(); + } } if (flag_create) {