state: fix a crash in error printing

cute-signatures
Timo Teräs 2010-06-03 22:03:02 +03:00
parent ce3cf8bff9
commit 069c898984
1 changed files with 1 additions and 1 deletions

View File

@ -838,7 +838,7 @@ void apk_state_print_errors(struct apk_state *state)
es.prevpkg = pkg = state->conflicts->item[i];
es.indent.x = es.indent.indent =
printf(" %s-%s:", pkg->name->name, pkg->version);
for (j = 0; j < pkg->depends->num; j++) {
for (j = 0; pkg->depends != NULL && j < pkg->depends->num; j++) {
r = apk_state_lock_dependency(state,
&pkg->depends->item[j]);
if (r != 0)