protect against "null" locale
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 18 Dec 2008 03:21:02 +0000 (03:21 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 18 Dec 2008 03:21:02 +0000 (03:21 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1531 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_message.c

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