[nautilus] mime-actions: null-check app info
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] mime-actions: null-check app info
- Date: Fri, 11 Aug 2017 19:16:09 +0000 (UTC)
commit cd78b1c9863a25a5fae0f2f7f98ca6d58681cbd6
Author: Ernestas Kulik <ernestask gnome org>
Date: Fri Aug 11 19:57:32 2017 +0300
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
src/nautilus-mime-actions.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 28f1da5..18066d6 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]