From 4c525f91f76896bde48b5e02c8b9446033d621b5 Mon Sep 17 00:00:00 2001 From: Corey Berla Date: Sun, 17 Jul 2022 23:17:03 -0700 Subject: list-view: Check if self is NULL before getting listbase If the view is no longer available i.e. switched to the GridView, this crashes. Simply move the call to nautilus_list_base_get_model() after the NULL check. --- src/nautilus-list-view.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c index 47169b575..380258396 100644 --- a/src/nautilus-list-view.c +++ b/src/nautilus-list-view.c @@ -901,11 +901,13 @@ unload_file_timeout (gpointer data) { g_autoptr (UnloadDelayData) unload_data = data; NautilusListView *self = unload_data->self; - NautilusViewModel *model = nautilus_list_base_get_model (NAUTILUS_LIST_BASE (self)); + NautilusViewModel *model; + if (unload_data->self == NULL) { return G_SOURCE_REMOVE; } + model = nautilus_list_base_get_model (NAUTILUS_LIST_BASE (self)); for (guint i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (model)); i++) { -- cgit v1.2.1