get_indexed_object can return NULL if nothing is in that slot; check for it

This fixes a segfault introduced by 051e400; via it, no longer able to trigger the http/smartserv race. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brian Harring committed Aug 23, 2011 at 22:47 UTC 2a74532412b9d87d4ad96dacbe9a31ff85f80af5
1 file changed +2
upload-pack.c
+2
@@ -533,6 +533,8 @@ static void check_non_tip(void)
533 namebuf[41] = '\n';
534 for (i = get_max_object_index(); 0 < i; ) {
535 o = get_indexed_object(--i);
536 + if (!o)
537 + continue;
538 if (!(o->flags & OUR_REF))
539 continue;
540 memcpy(namebuf + 1, sha1_to_hex(o->sha1), 40);