[gnome-text-editor] session: make sure we have a file before dup'ing



commit e9fd3cfc09b7fed815fb0fd78d800d29fb287504
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jul 16 16:24:17 2021 -0700

    session: make sure we have a file before dup'ing

 src/editor-session.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/editor-session.c b/src/editor-session.c
index 62c107e..770bc21 100644
--- a/src/editor-session.c
+++ b/src/editor-session.c
@@ -2098,10 +2098,9 @@ _editor_session_forget (EditorSession *self,
   g_return_if_fail (EDITOR_IS_SESSION (self));
   g_return_if_fail (!file || G_IS_FILE (file));
 
-  g_hash_table_insert (self->forgot, g_file_dup (file), NULL);
-
   if (file != NULL)
     {
+      g_hash_table_insert (self->forgot, g_file_dup (file), NULL);
       _editor_sidebar_model_remove_file (self->recents, file);
       g_hash_table_remove (self->seen, file);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]