xbps_array_foreach_cb: replace an assertion with a real test, for non working repos.

This commit is contained in:
Juan RP 2013-07-27 20:01:23 +02:00
parent 0c7701f2bc
commit 49fa951836

View File

@ -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;