diff --git a/lib/repo.c b/lib/repo.c index 76c559a0..7a3d591c 100644 --- a/lib/repo.c +++ b/lib/repo.c @@ -336,9 +336,6 @@ xbps_repo_get_pkg_revdeps(struct xbps_repo *repo, const char *pkg) char *buf = NULL; bool match = false; - if (repo->idx == NULL) - return NULL; - if (((pkgd = xbps_rpool_get_pkg(repo->xhp, pkg)) == NULL) && ((pkgd = xbps_rpool_get_virtualpkg(repo->xhp, pkg)) == NULL)) { errno = ENOENT; diff --git a/lib/rpool.c b/lib/rpool.c index e2558cad..3dcdada4 100644 --- a/lib/rpool.c +++ b/lib/rpool.c @@ -158,6 +158,10 @@ xbps_rpool_foreach(struct xbps_handle *xhp, } /* Iterate over repository pool */ SIMPLEQ_FOREACH(rp, &rpool_queue, entries) { + /* ignore invalid repos */ + if (rp->repo->idx == NULL) + continue; + rv = (*fn)(rp->repo, arg, &done); if (rv != 0 || done) break;