]> err.no Git - libchamplain/commitdiff
Return XSRETURN_EMPTY if champlain_polygon_get_points() has no points
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Wed, 8 Jul 2009 21:11:32 +0000 (23:11 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 28 Jul 2009 21:25:16 +0000 (17:25 -0400)
bindings/perl/Champlain/xs/ChamplainPolygon.xs

index 4bec9e4e5166f7dd0d853c66edb7975bb6ee766e..c6e28f591149ff3a38520a97979bbaffab01f26d 100644 (file)
@@ -28,7 +28,11 @@ champlain_polygon_get_points (ChamplainPolygon *polygon)
        
        PPCODE:
                item = champlain_polygon_get_points(polygon);
-               
+
+               if (!item) {
+                       XSRETURN_EMPTY;
+               }
+
                for (; item != NULL; item = item->next) {
                        ChamplainPoint *point = CHAMPLAIN_POINT(item->data);
                        XPUSHs(sv_2mortal(newSVChamplainPoint(point)));