Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
props dict does not always exists anymore. Check if not NULL before
authorsuter <suter@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 25 Feb 2011 09:02:16 +0000 (09:02 +0000)
committersuter <suter@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 25 Feb 2011 09:02:16 +0000 (09:02 +0000)
asking for length

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9718 48e7efb5-ca39-0410-a469-dd3cf9ba447f

teshsuite/simdag/platforms/flatifier.c

index 813c866..eac56b1 100644 (file)
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
            SD_workstation_get_name(hosts[i]),
            SD_workstation_get_power(hosts[i]));
     props = SD_workstation_get_properties(hosts[i]);
            SD_workstation_get_name(hosts[i]),
            SD_workstation_get_power(hosts[i]));
     props = SD_workstation_get_properties(hosts[i]);
-    if (xbt_dict_length(props) > 0) {
+    if (props && xbt_dict_length(props) > 0) {
       printf(">\n");
       xbt_dict_foreach(props, cursor, key, data) {
         printf("    <prop id=\"%s\" value=\"%s\"/>\n", key, data);
       printf(">\n");
       xbt_dict_foreach(props, cursor, key, data) {
         printf("    <prop id=\"%s\" value=\"%s\"/>\n", key, data);