Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Catch not_found_error. I'm just restoring the previous semantic... We have to decide...
[simgrid.git] / src / xbt / dict.c
index 37bc175..1327951 100644 (file)
@@ -128,9 +128,18 @@ xbt_dict_get_ext(xbt_dict_t      dict,
 void *
 xbt_dict_get(xbt_dict_t     dict,
              const char     *key) {
+  xbt_ex_t e;
   xbt_assert(dict);
 
-  return xbt_dictelm_get(dict->head, key);
+  TRY {
+    return xbt_dictelm_get(dict->head, key);
+  } CATCH(e) {
+    if(e.category==not_found_error) {
+      return NULL;
+    }
+    RETHROW;
+  }
+  return NULL;
 }
 
 /**