[nautilus/wip/antoniof/new-list-view-continuation: 79/81] list-view: Check if self is NULL before getting listbase
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/new-list-view-continuation: 79/81] list-view: Check if self is NULL before getting listbase
- Date: Sun, 7 Aug 2022 01:52:39 +0000 (UTC)
commit 9dd68b6317814ef97b95b375da9e88bee50a4f8f
Author: Corey Berla <corey berla me>
Date: Sun Jul 17 23:17:03 2022 -0700
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 dd474724b..760c43197 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -925,11 +925,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++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]