diff --git a/attr.c b/attr.c index 300f994ba6e283..a2e0775f7e50d0 100644 --- a/attr.c +++ b/attr.c @@ -865,7 +865,8 @@ static struct attr_stack *read_attr_from_index(struct index_state *istate, stack = read_attr_from_blob(istate, &istate->cache[sparse_dir_pos]->oid, relative_path, flags); } else { buf = read_blob_data_from_index(istate, path, &size); - stack = read_attr_from_buf(buf, size, path, flags); + if (buf) + stack = read_attr_from_buf(buf, size, path, flags); } return stack; }