From: Michael Catanzaro Date: Thu, 23 Feb 2023 15:20:03 +0000 (-0600) Subject: filesystemmodel: fix crash when file is removed X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~6^2~37^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c141d0a70a5e6190d3a473effe82a7563cd59c97;p=gtk4.git filesystemmodel: fix crash when file is removed In 32247bc50e63b709ae738a95a2ec71345b5fad75 node_get_for_file() was changed to return GTK_INVALID_LIST_POSITION rather than 0 when the file is untracked. Most call sites were updated accordingly, but this one was missed. Fixes #5619 --- diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index c085022e19..9f4a5fafa9 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -459,7 +459,7 @@ remove_file (GtkFileSystemModel *model, g_return_if_fail (G_IS_FILE (file)); id = node_get_for_file (model, file); - if (id == 0) + if (id == GTK_INVALID_LIST_POSITION) return; node = get_node (model, id);