diff options
author | Ton Roosendaal <ton@blender.org> | 2008-01-01 17:13:37 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-01-01 17:13:37 +0300 |
commit | 65f1999435224c14ddbe232535dacd52b1ae465a (patch) | |
tree | 31daf3da5854cee0949bd17822fb48e83c5b9288 /source/blender/blenlib/intern/BLI_ghash.c | |
parent | 3ef896a9453acb8c564b8a8fd97885958c733436 (diff) |
Bugfix #8032
The warning i've coded 1.5 year ago, to warn when a .blend was written
by newer executable, failed on the .B.blend load case... UI not property
initialized then.
This at least fixes the crash, a menu won't pop up correctly though...
luckily the warning works for regular load or ctrl-x
Diffstat (limited to 'source/blender/blenlib/intern/BLI_ghash.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 5846bbda40e..6af377edfba 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -117,14 +117,16 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val) { } } -void* BLI_ghash_lookup(GHash *gh, void *key) { - unsigned int hash= gh->hashfp(key)%gh->nbuckets; - Entry *e; - - for (e= gh->buckets[hash]; e; e= e->next) - if (gh->cmpfp(key, e->key)==0) - return e->val; - +void* BLI_ghash_lookup(GHash *gh, void *key) +{ + if(gh) { + unsigned int hash= gh->hashfp(key)%gh->nbuckets; + Entry *e; + + for (e= gh->buckets[hash]; e; e= e->next) + if (gh->cmpfp(key, e->key)==0) + return e->val; + } return NULL; } |