If as_map_size > 0, it works.
Do you have a code snippet that demonstrates this problem?
The map must be initialized with as_hashmap_init() and the iterator must be initialized with as_hashmap_iterator_init() before calling as_hashmap_iterator_has_next().