From: navarrop Date: Wed, 9 Mar 2011 16:41:25 +0000 (+0000) Subject: Return SURF_NETWORK_ELEMENT_NULL if the elements is not found. X-Git-Tag: v3.6_beta2~188 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/04446484b754854fb4e9cd3ef649bdc56dcc5d86 Return SURF_NETWORK_ELEMENT_NULL if the elements is not found. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9772 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 42a3b989af..c94cd5ca9c 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1072,7 +1072,8 @@ static e_surf_network_element_type_t get_network_element_type(const char *name) { network_element_info_t rc = NULL; - rc = xbt_dict_get(global_routing->where_network_elements, name); + rc = xbt_dict_get_or_null(global_routing->where_network_elements, name); + if(!rc) return SURF_NETWORK_ELEMENT_NULL; return rc->rc_type; }