]> mj.ucw.cz Git - leo.git/blobdiff - osm.c
css.h: Fixed a wrong type
[leo.git] / osm.c
diff --git a/osm.c b/osm.c
index 862f7fbb52012cdcf76221a15879cdc60beace04..c21e0d9e9ab72e75cf38f6b1b88299c67a699d5a 100644 (file)
--- a/osm.c
+++ b/osm.c
@@ -12,6 +12,8 @@
 
 #include <stdarg.h>
 #include <stdio.h>
+
+#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
 #include <proj_api.h>
 
 #include "leo.h"
@@ -382,7 +384,7 @@ static void mpg_walk_boundary(struct osm_multipolygon *m, bool inner)
          clist_init(&b->nodes);
 
          struct mpg_vertex *w = v;
-         while (!w->visited)
+         while (w && !w->visited)
            {
              w->visited = 1;
              struct osm_ref *f = mp_alloc(osm_this->pool, sizeof(*f));
@@ -412,7 +414,9 @@ static void mpg_walk_boundary(struct osm_multipolygon *m, bool inner)
              w = dest;
            }
 
-         if (w != v)
+         if (!w)
+           osm_obj_warn(&mpg_current->o, "Boundary not closed");
+         else if (w != v)
            osm_obj_warn(&mpg_current->o, "Boundary not closed at node %ju", (uintmax_t) w->o->id);
 
          struct osm_ref *f = mp_alloc(osm_this->pool, sizeof(*f));