diff --git a/fsck-objects.c b/fsck-objects.c
index 9950be264501a5c99eafe7c2438b27b857ba6402..6439d55126a615c04db1be16ebcaf8b0af9f7ae3 100644 (file)
--- a/fsck-objects.c
+++ b/fsck-objects.c
int i;
/* Look up all the requirements, warn about missing objects.. */
int i;
/* Look up all the requirements, warn about missing objects.. */
- for (i = 0; i < nr_objs; i++) {
+ for (i = 0; i < obj_allocs; i++) {
struct object *obj = objs[i];
struct object *obj = objs[i];
+ if (!obj)
+ continue;
+
if (!obj->parsed) {
if (!standalone && has_sha1_file(obj->sha1))
; /* it is in pack */
if (!obj->parsed) {
if (!standalone && has_sha1_file(obj->sha1))
; /* it is in pack */