summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2025-02-20 02:45:37 -0500
committerlukefromdc <[email protected]>2025-02-20 02:45:37 -0500
commit879e5e3401dd14ecd8146e0b504d885912bb9adb (patch)
treee74a5e58da69176c62b9b5436b50d77bafe147dc
parent5dd952912b3ce5d0fd511b0da08e5465d59d0aad (diff)
downloadcaja-wl-crash-on-close.tar.bz2
caja-wl-crash-on-close.tar.xz
fm-icon-view: catch possible null pointer dereference found by cppcheckwl-crash-on-close
-rw-r--r--src/file-manager/fm-icon-view.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c
index 83517273..2835915e 100644
--- a/src/file-manager/fm-icon-view.c
+++ b/src/file-manager/fm-icon-view.c
@@ -358,6 +358,12 @@ real_set_sort_criterion (FMIconView *icon_view,
else
{
/* Store the new sort setting. */
+ if (!(sort))
+ return;
+
+ if (!(sort->metadata_text))
+ return;
+
fm_icon_view_set_directory_sort_by (icon_view,
file,
sort->metadata_text);