From d52c0bac01e1804d654996ac08329c879c8dbf9f Mon Sep 17 00:00:00 2001 From: Alexander Schwinn Date: Thu, 6 May 2021 10:23:07 +0200 Subject: Prevent crash if invalid-symlink is used as bookmark (Issue #552) - Required to check if bookmark actually is a directory --- thunar/thunar-shortcuts-view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thunar/thunar-shortcuts-view.c b/thunar/thunar-shortcuts-view.c index 428c75e2..039b63d4 100644 --- a/thunar/thunar-shortcuts-view.c +++ b/thunar/thunar-shortcuts-view.c @@ -1235,7 +1235,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS } /* create provider menu items if there is a non-trashed file */ - if (G_LIKELY (file != NULL && !thunar_file_is_trashed (file))) + if (G_LIKELY (file != NULL && !thunar_file_is_trashed (file) && thunar_file_is_directory (file))) { /* load the menu providers from the provider factory */ providers = thunarx_provider_factory_list_providers (view->provider_factory, THUNARX_TYPE_MENU_PROVIDER); @@ -1680,7 +1680,7 @@ thunar_shortcuts_view_poke_file_finish (ThunarBrowser *browser, _thunar_return_if_fail (THUNAR_IS_SHORTCUTS_VIEW (browser)); _thunar_return_if_fail (THUNAR_IS_FILE (target_file)); - if (error == NULL) + if (G_LIKELY (error == NULL && thunar_file_is_directory (target_file) == TRUE)) { if (open_in == OPEN_IN_WINDOW) { -- cgit v1.2.1