[libchamplain] Return XSRETURN_EMPTY if champlain_polygon_get_points() has no points
- From: Pierre-Luc Beaudoin <plbeaudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [libchamplain] Return XSRETURN_EMPTY if champlain_polygon_get_points() has no points
- Date: Tue, 28 Jul 2009 21:39:58 +0000 (UTC)
commit a1f1d457290c3b27dc5bd4d0258767df0d7cd6e1
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date: Wed Jul 8 23:11:32 2009 +0200
Return XSRETURN_EMPTY if champlain_polygon_get_points() has no points
bindings/perl/Champlain/xs/ChamplainPolygon.xs | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
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)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]