From a2b34b7e6bf747d295f33124fc1019413808bb53 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Tue, 20 Apr 2021 10:50:28 +0300 Subject: [PATCH] LibDesktop: Fail gracefully on allowlist failures instead of asserting IPC::Connection::send_sync asserts that a response was received, so the current gracefull fail check was useless, as LibIPC would always assert before reaching it. --- Userland/Libraries/LibDesktop/Launcher.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibDesktop/Launcher.cpp b/Userland/Libraries/LibDesktop/Launcher.cpp index c81eff8a46..59cdc128b8 100644 --- a/Userland/Libraries/LibDesktop/Launcher.cpp +++ b/Userland/Libraries/LibDesktop/Launcher.cpp @@ -79,7 +79,7 @@ static LaunchServerConnection& connection() bool Launcher::add_allowed_url(const URL& url) { - auto response = connection().send_sync(url); + auto response = connection().send_sync_but_allow_failure(url); if (!response) { dbgln("Launcher::add_allowed_url: Failed"); return false; @@ -89,7 +89,7 @@ bool Launcher::add_allowed_url(const URL& url) bool Launcher::add_allowed_handler_with_any_url(const String& handler) { - auto response = connection().send_sync(handler); + auto response = connection().send_sync_but_allow_failure(handler); if (!response) { dbgln("Launcher::add_allowed_handler_with_any_url: Failed"); return false; @@ -99,7 +99,7 @@ bool Launcher::add_allowed_handler_with_any_url(const String& handler) bool Launcher::add_allowed_handler_with_only_specific_urls(const String& handler, const Vector& urls) { - auto response = connection().send_sync(handler, urls); + auto response = connection().send_sync_but_allow_failure(handler, urls); if (!response) { dbgln("Launcher::add_allowed_handler_with_only_specific_urls: Failed"); return false; @@ -109,7 +109,7 @@ bool Launcher::add_allowed_handler_with_only_specific_urls(const String& handler bool Launcher::seal_allowlist() { - auto response = connection().send_sync(); + auto response = connection().send_sync_but_allow_failure(); if (!response) { dbgln("Launcher::seal_allowlist: Failed"); return false;