src/map.c

changeset 1600
a1a728d7ebfd
parent 1587
7156d6699410
child 1604
68b75c091028
--- a/src/map.c	Sun Dec 14 14:15:26 2025 +0100
+++ b/src/map.c	Sun Dec 14 14:29:27 2025 +0100
@@ -114,7 +114,9 @@
 }
 
 void *cx_map_emplace(CxMap *map, CxHashKey key) {
-    return map->cl->put(map, key, NULL).value;
+    const CxMapEntry entry = map->cl->put(map, key, NULL);
+    if (entry.key == NULL) return NULL;
+    return entry.value;
 }
 
 void *cx_map_get(const CxMap *map, CxHashKey key) {

mercurial