From: alegrand Date: Thu, 25 Aug 2005 22:14:38 +0000 (+0000) Subject: Catch not_found_error. I'm just restoring the previous semantic... We have to decide... X-Git-Tag: v3.3~3694 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b85cfb5c5c896217c19efbd161886ce5b52ec090?ds=inline Catch not_found_error. I'm just restoring the previous semantic... We have to decide whether this should be done here or by people calling this function... The nice point with letting others do it is that it enables to store NULL pointers in a dict. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1663 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/dict.c b/src/xbt/dict.c index 37bc17511d..1327951c25 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -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; } /**