From 49fa9518368ad99a9ff6796584ab2034cc5931da Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 27 Jul 2013 20:01:23 +0200 Subject: [PATCH] xbps_array_foreach_cb: replace an assertion with a real test, for non working repos. --- lib/plist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/plist.c b/lib/plist.c index 14ce9dd2..25214bca 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -131,9 +131,11 @@ xbps_array_foreach_cb(struct xbps_handle *xhp, unsigned int arraycount, slicecount, pkgcount; int rv = 0, maxthreads, i; - assert(xbps_object_type(array) == XBPS_TYPE_ARRAY); assert(fn != NULL); + if (xbps_object_type(array) != XBPS_TYPE_ARRAY) + return 0; + arraycount = xbps_array_count(array); if (arraycount == 0) return 0;