changeset 16342:b1c1b2319616

When initializing, the debug system is initialized before the prefs system, but debug calls will end up calling prefs functions, so we need to deal with that situation cleanly. I noticed this when using the debug functions in the core migration code.
author Richard Laager <rlaager@wiktel.com>
date Mon, 23 Apr 2007 16:59:37 +0000
parents 08557e94840c
children 70b48f559312 b75f27a09a92
files libpurple/prefs.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/prefs.c	Mon Apr 23 16:28:10 2007 +0000
+++ b/libpurple/prefs.c	Mon Apr 23 16:59:37 2007 +0000
@@ -92,7 +92,16 @@
 	if (name[1] == '\0')
 		return &prefs;
 	else
-		return g_hash_table_lookup(prefs_hash, name);
+	{
+		/* When we're initializing, the debug system is
+		 * initialized before the prefs system, but debug
+		 * calls will end up calling prefs functions, so we
+		 * need to deal cleanly here. */
+		if (prefs_hash)
+			return g_hash_table_lookup(prefs_hash, name);
+		else
+			return NULL;
+	}
 }