From 5aeb898869fc7a3d4107802dc5b95bee6f50cb13 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Wed, 11 Jan 2023 14:00:34 +0100 Subject: directory: Prevent usage of uninitialized hash table I see regularly the following debug print on Nautilus startup: `GLib-CRITICAL **: 10:52:52.992: g_hash_table_foreach: assertion 'hash_table != NULL' failed`. This is because the `emit_change_signals_for_all_files_in_all_directories` function is called before the `directories` hash table is initialzed. Let's return early to prevent usage of the uninitialized hash table. --- src/nautilus-directory.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nautilus-directory.c b/src/nautilus-directory.c index 611afb6ef..aa6a89809 100644 --- a/src/nautilus-directory.c +++ b/src/nautilus-directory.c @@ -434,6 +434,11 @@ emit_change_signals_for_all_files_in_all_directories (void) GList *dirs, *l; NautilusDirectory *directory; + if (directories == NULL) + { + return; + } + dirs = NULL; g_hash_table_foreach (directories, collect_all_directories, -- cgit v1.2.1