From: Emmanuel Rodriguez Date: Wed, 8 Jul 2009 21:11:32 +0000 (+0200) Subject: Return XSRETURN_EMPTY if champlain_polygon_get_points() has no points X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1f1d457290c3b27dc5bd4d0258767df0d7cd6e1;p=libchamplain Return XSRETURN_EMPTY if champlain_polygon_get_points() has no points --- diff --git a/bindings/perl/Champlain/xs/ChamplainPolygon.xs b/bindings/perl/Champlain/xs/ChamplainPolygon.xs index 4bec9e4..c6e28f5 100644 --- a/bindings/perl/Champlain/xs/ChamplainPolygon.xs +++ b/bindings/perl/Champlain/xs/ChamplainPolygon.xs @@ -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)));