index: fix segfault bug when trying to deleting an unresolved dep

cute-signatures
Natanael Copa 2009-05-14 07:18:11 +00:00
parent 83840727f0
commit 6db3bbd790
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ static int index_main(void *ctx, int argc, char **argv)
if (ictx->delete) {
struct apk_name *name;
name = apk_db_query_name(&db, APK_BLOB_STR(argv[i]));
if (name == NULL)
if (name == NULL || name->pkgs == NULL)
continue;
/* apk_db_index_write() will only print the pkgs
where repos == 0. We prevent to write the given