diff --git a/src/polygon.c b/src/polygon.c index dbc875a..1464577 100644 --- a/src/polygon.c +++ b/src/polygon.c @@ -918,6 +918,14 @@ spherepoly_rad(PG_FUNCTION_ARGS) np = ArrayGetNItems(ARR_NDIM(float_vector), ARR_DIMS(float_vector)); + if (ARR_HASNULL(float_vector)) + { + elog( ERROR, + "spherepoly_rad: invalid array has null values" + ); + PG_RETURN_NULL(); + } + if (np < 6 || np % 2 != 0) { elog( ERROR, @@ -960,6 +968,14 @@ spherepoly_deg(PG_FUNCTION_ARGS) np = ArrayGetNItems(ARR_NDIM(float_vector), ARR_DIMS(float_vector)); + if (ARR_HASNULL(float_vector)) + { + elog( ERROR, + "spherepoly_deg: invalid array has null values" + ); + PG_RETURN_NULL(); + } + if (np < 6 || np % 2 != 0) { elog( ERROR,