Fix:maptool:Don't crash on NULL strings
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 2 May 2010 15:00:54 +0000 (15:00 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sun, 2 May 2010 15:00:54 +0000 (15:00 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3220 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/maptool/misc.c

index 73c3d95..541a46f 100644 (file)
@@ -113,8 +113,10 @@ phase1_map(GList *maps, FILE *out_ways, FILE *out_nodes)
                        while (item_attr_get(item, attr_any, &attr)) {
                                if (attr.type >= attr_type_string_begin && attr.type <= attr_type_string_end) {
                                        attr.u.str=map_convert_string(maps->data, attr.u.str);
-                                       item_bin_add_attr(item_bin, &attr);
-                                       map_convert_free(attr.u.str);
+                                       if (attr.u.str) {
+                                               item_bin_add_attr(item_bin, &attr);
+                                               map_convert_free(attr.u.str);
+                                       }
                                } else 
                                        item_bin_add_attr(item_bin, &attr);
                        }