Commit 3e218797 authored by Timm Bäder's avatar Timm Bäder 🤔

gappinfo: Clear previously set error before calling portal

Otherwise, we might end up returning TRUE from
g_app_info_launch_default_for_uri but with a set error parameter. This
will lead to confusing results depending on how the caller checks for
errors. Checking error != NULL indicats the call failed but checking the
return value indicates that it succeeded.
parent cbcf1041
......@@ -984,7 +984,12 @@ g_app_info_launch_default_for_uri (const char *uri,
#ifdef G_OS_UNIX
if (glib_should_use_portal ())
return launch_default_with_portal (uri, launch_context, error);
/* Reset any error previously set by launch_default_for_uri */
g_clear_error (error);
return launch_default_with_portal (uri, launch_context, error);
return FALSE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment