more explicit "is it NULL" test
authormiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Sat, 17 Jan 2009 16:37:13 +0000 (16:37 +0000)
committermiker <miker@9efc2488-bf62-4759-914b-345cdb29e865>
Sat, 17 Jan 2009 16:37:13 +0000 (16:37 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/rel_1_0@1628 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_message.c

index c9e85c4..ee6604e 100644 (file)
@@ -311,7 +311,8 @@ int osrf_message_deserialize(const char* string, osrfMessage* msgs[], int count)
 
                        tmp = jsonObjectGetKeyConst(message, "locale");
 
-                       if(tmp && (new_msg->sender_locale = jsonObjectToSimpleString(tmp))) {
+                       if(tmp && tmp->type != JSON_NULL) {
+                               new_msg->sender_locale = jsonObjectToSimpleString(tmp);
                                current_locale = strdup( new_msg->sender_locale );
                        } else {
                                current_locale = NULL;