From 1a223d07e10d6df049cd42505d95027d2757603c Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Fri, 9 Feb 2024 05:55:02 +0000 Subject: [PATCH] LibGUI: Assert that most recently open file path isn't empty Attempting to do this causes a crash. It's better to fail early in this case, so that the cause of the failure is clear. --- Userland/Libraries/LibGUI/Application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index f59300d03c..df85bc4ae5 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -373,6 +373,7 @@ void Application::update_recent_file_actions() void Application::set_most_recently_open_file(ByteString new_path) { + VERIFY(!new_path.is_empty()); Vector new_recent_files_list; for (size_t i = 0; i < max_recently_open_files(); ++i) {