mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
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.
This commit is contained in:
parent
cbcf10411c
commit
3e2187975d
@ -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);
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user