mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
mime-actions: null-check app info
When deciding on the activation action, the code checks if Nautilus is the default handler for archives. There are cases when the returned application info is invalid, e.g. for application/octet-stream. https://bugzilla.gnome.org/show_bug.cgi?id=786168
This commit is contained in:
parent
cd462d2163
commit
cd78b1c986
|
@ -710,13 +710,16 @@ get_activation_action (NautilusFile *file)
|
|||
{
|
||||
ActivationAction action;
|
||||
char *activation_uri;
|
||||
gboolean handles_extract;
|
||||
gboolean handles_extract = FALSE;
|
||||
g_autoptr (GAppInfo) app_info = NULL;
|
||||
const gchar* app_id;
|
||||
|
||||
app_info = nautilus_mime_get_default_application_for_file (file);
|
||||
app_id = g_app_info_get_id (app_info);
|
||||
handles_extract = g_strcmp0 (app_id, NAUTILUS_DESKTOP_ID) == 0;
|
||||
if (app_info != NULL)
|
||||
{
|
||||
app_id = g_app_info_get_id (app_info);
|
||||
handles_extract = g_strcmp0 (app_id, NAUTILUS_DESKTOP_ID) == 0;
|
||||
}
|
||||
if (handles_extract && nautilus_file_is_archive (file))
|
||||
{
|
||||
return ACTIVATION_ACTION_EXTRACT;
|
||||
|
|
Loading…
Reference in a new issue