diff --git a/hashmap.c b/hashmap.c index 3978400..0ceea56 100644 --- a/hashmap.c +++ b/hashmap.c @@ -311,7 +311,8 @@ int hashmap_get(map_t in, char* key, any_t *arg){ curr = (curr + 1) % m->table_size; } - *arg = NULL; + if(arg != NULL) + *arg = NULL; /* Not found */ return MAP_MISSING; @@ -394,4 +395,4 @@ int hashmap_length(map_t in){ hashmap_map* m = (hashmap_map *) in; if(m != NULL) return m->size; else return 0; -} \ No newline at end of file +}