summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Schwinn <alexxcons@xfce.org>2021-05-06 10:23:07 +0200
committerAlexander Schwinn <alexxcons@xfce.org>2021-05-06 10:37:24 +0200
commitd52c0bac01e1804d654996ac08329c879c8dbf9f (patch)
tree9381af4d4a7ef2d6f79ba22a961a538fb59e75a6
parentbc2b69e64e3c520ddf45b983ae24b1a7296aa9a2 (diff)
downloadthunar-d52c0bac01e1804d654996ac08329c879c8dbf9f.tar.gz
Prevent crash if invalid-symlink is used as bookmark (Issue #552)
- Required to check if bookmark actually is a directory
-rw-r--r--thunar/thunar-shortcuts-view.c4
1 files 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)
{