Fixed account_toxmlnode() so that xmlnode funcctions are not called if we have nothing to put in them. soc.2008.masterpassword

Wed, 27 Aug 2008 09:52:21 +0000

author
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
date
Wed, 27 Aug 2008 09:52:21 +0000
branch
soc.2008.masterpassword
changeset 34010
cd639f4079d3
parent 34009
8e996cb3581a
child 34011
6ae90dd5a3b8

Fixed account_toxmlnode() so that xmlnode funcctions are not called if we have nothing to put in them.

libpurple/account.c file | annotate | diff | comparison | revisions
--- a/libpurple/account.c	Wed Aug 27 09:47:09 2008 +0000
+++ b/libpurple/account.c	Wed Aug 27 09:52:21 2008 +0000
@@ -415,9 +415,12 @@
 
 		} else {
 			child = xmlnode_new_child(node, "password");
-			xmlnode_set_attrib(child, "keyring_id", keyring_id);
-			xmlnode_set_attrib(child, "mode", mode);
-			xmlnode_insert_data(child, data, -1);
+			if (keyring_id != NULL)
+				xmlnode_set_attrib(child, "keyring_id", keyring_id);
+			if (mode != NULL)
+				xmlnode_set_attrib(child, "mode", mode);
+			if (data != NULL)
+				xmlnode_insert_data(child, data, -1);
 
 			if (destroy != NULL)
 				destroy(data);

mercurial