diff options
author | Andre Miranda <andreldm@xfce.org> | 2019-05-23 22:41:28 -0300 |
---|---|---|
committer | Andre Miranda <andreldm@xfce.org> | 2019-05-23 22:41:28 -0300 |
commit | 479655f5ccaf9189d9599c941c563fe5ae32578e (patch) | |
tree | 866c09cbcc62e67818527011c46c9eea58adde37 /thunar/thunar-tree-view.c | |
parent | 2b3082c04605947947f2ee48e3858dfcd3a81b6f (diff) | |
download | thunar-479655f5ccaf9189d9599c941c563fe5ae32578e.tar.gz |
Fix crash on unmounted volume in tree pane right click (Bug #15452)
Diffstat (limited to 'thunar/thunar-tree-view.c')
-rw-r--r-- | thunar/thunar-tree-view.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 9752138a..ceb117b2 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -1360,7 +1360,11 @@ G_GNUC_END_IGNORE_DEPRECATIONS gtk_widget_show (item); } - if (G_UNLIKELY (thunar_g_file_is_trash (thunar_file_get_file (file)))) + if (G_UNLIKELY (file == NULL)) + { + /* do nothing */ + } + else if (G_UNLIKELY (thunar_g_file_is_trash (thunar_file_get_file (file)))) { /* append the "Empty Trash" menu action */ item = gtk_menu_item_new_with_mnemonic (_("_Empty Trash")); @@ -1374,7 +1378,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); } - else if (G_LIKELY (file != NULL)) + else { /* check if we have a non-trashed resource */ if (G_LIKELY (!thunar_file_is_trashed (file))) |