changeset 7848:64d1a90f5a78

[gaim-migrate @ 8502] thank you Bill Tompkins (obobo) committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 13 Dec 2003 17:06:10 +0000
parents f10b8832360f
children 2920debcb3c3
files src/blist.c
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/blist.c	Sat Dec 13 07:05:02 2003 +0000
+++ b/src/blist.c	Sat Dec 13 17:06:10 2003 +0000
@@ -2534,7 +2534,10 @@
 
 	setting = g_hash_table_lookup(node->settings, key);
 
-	return setting ? setting->value.boolean : FALSE;
+	g_return_val_if_fail(setting != NULL, FALSE);
+	g_return_val_if_fail(setting->type == GAIM_BLIST_NODE_SETTING_BOOL, FALSE);
+
+	return setting->value.boolean;
 }
 
 void gaim_blist_node_set_int(GaimBlistNode* node, const char *key, int value)
@@ -2562,7 +2565,10 @@
 
 	setting = g_hash_table_lookup(node->settings, key);
 
-	return setting ? setting->value.integer : 0;
+	g_return_val_if_fail(setting != NULL, 0);
+	g_return_val_if_fail(setting->type == GAIM_BLIST_NODE_SETTING_INT, 0);
+
+	return setting->value.integer;
 }
 
 void gaim_blist_node_set_string(GaimBlistNode* node, const char *key,
@@ -2591,7 +2597,10 @@
 
 	setting = g_hash_table_lookup(node->settings, key);
 
-	return setting ? setting->value.string : NULL;
+	g_return_val_if_fail(setting != NULL, NULL);
+	g_return_val_if_fail(setting->type == GAIM_BLIST_NODE_SETTING_STRING, NULL);
+
+	return setting->value.string;
 }