diff options
Diffstat (limited to 'src/std/hash_map.c')
-rw-r--r-- | src/std/hash_map.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/std/hash_map.c b/src/std/hash_map.c index b4bd4c1..4bf55c6 100644 --- a/src/std/hash_map.c +++ b/src/std/hash_map.c @@ -224,6 +224,9 @@ bool hash_map_get_ref(HashMap *self, BufferView key, void **value) { HashMapBucketNode *bucket_node; bucket_size = buffer_get_size(&self->buckets, HashMapBucket); + if(bucket_size == 0) + return bool_false; + hash = self->hash_func((const u8*)key.data, key.size); bucket_index = hash % bucket_size; |