state: world might be empty

so do not choke on it.
cute-signatures
Timo Teras 2009-08-05 12:28:00 +03:00
parent bb77b01244
commit 1a67a8e2b6
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ struct apk_state *apk_state_new(struct apk_database *db)
/* Instantiate each 'name' target in world, and lockout incompatible
* choices */
for (i = 0; i < db->world->num; i++) {
for (i = 0; db->world != NULL && i < db->world->num; i++) {
r = apk_state_prune_dependency(state, &db->world->item[i]);
if (r < 0) {
apk_error("Top level dependencies for %s are "