diff options
author | Andre Miranda <andreldm@xfce.org> | 2018-07-14 19:18:42 -0300 |
---|---|---|
committer | Andre Miranda <andreldm@xfce.org> | 2018-07-14 19:18:42 -0300 |
commit | 2dd76b4cb5221aeef68d7adc755e6370a6b03d6d (patch) | |
tree | 46e0fb66889441d9e529c5a04b229612cf92fba3 /thunar/thunar-window.c | |
parent | c52fdde9cffbf32d7b82a1ede17e0fca79deb486 (diff) | |
download | thunar-2dd76b4cb5221aeef68d7adc755e6370a6b03d6d.tar.gz |
Don't try to load menu providers if current dir is invalid
Diffstat (limited to 'thunar/thunar-window.c')
-rw-r--r-- | thunar/thunar-window.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c index 6db84bf3..ebe50af2 100644 --- a/thunar/thunar-window.c +++ b/thunar/thunar-window.c @@ -3443,14 +3443,18 @@ thunar_window_update_custom_actions (ThunarView *view, || window->view != GTK_WIDGET (view)) return; + /* grab a reference to the current directory of the window */ + folder = thunar_window_get_current_directory (window); + + /* leave if current directory is invalid */ + if (!thunarx_file_info_is_directory (THUNARX_FILE_INFO (folder))) + return; + /* load the menu provides from the provider factory */ providers = thunarx_provider_factory_list_providers (window->provider_factory, THUNARX_TYPE_MENU_PROVIDER); if (G_LIKELY (providers != NULL)) { - /* grab a reference to the current directory of the window */ - folder = thunar_window_get_current_directory (window); - /* get a list of selected files */ selected_files = thunar_component_get_selected_files (THUNAR_COMPONENT (view)); |