check NULL-ness on hash the key before calling find_item
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 23 Jul 2009 02:03:38 +0000 (02:03 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Thu, 23 Jul 2009 02:03:38 +0000 (02:03 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1727 9efc2488-bf62-4759-914b-345cdb29e865

src/libopensrf/osrf_hash.c

index 377d595..c00df90 100644 (file)
@@ -253,6 +253,7 @@ void* osrfHashRemove( osrfHash* hash, const char* key, ... ) {
 
 
 void* osrfHashGet( osrfHash* hash, const char* key ) {
+       if(!(hash && key )) return NULL;
        osrfHashNode* node = find_item( hash, key, NULL );
        if( !node ) return NULL;
        return node->item;