@@ -2670,7 +2670,7 @@ static struct commit *find_single_final(struct rev_info *revs,
2670
2670
if (obj -> flags & UNINTERESTING )
2671
2671
continue ;
2672
2672
obj = deref_tag (revs -> repo , obj , NULL , 0 );
2673
- if (obj -> type != OBJ_COMMIT )
2673
+ if (! obj || obj -> type != OBJ_COMMIT )
2674
2674
die ("Non commit %s?" , revs -> pending .objects [i ].name );
2675
2675
if (found )
2676
2676
die ("More than one commit to dig from %s and %s?" ,
@@ -2701,7 +2701,7 @@ static struct commit *dwim_reverse_initial(struct rev_info *revs,
2701
2701
/* Is that sole rev a committish? */
2702
2702
obj = revs -> pending .objects [0 ].item ;
2703
2703
obj = deref_tag (revs -> repo , obj , NULL , 0 );
2704
- if (obj -> type != OBJ_COMMIT )
2704
+ if (! obj || obj -> type != OBJ_COMMIT )
2705
2705
return NULL ;
2706
2706
2707
2707
/* Do we have HEAD? */
@@ -2737,7 +2737,7 @@ static struct commit *find_single_initial(struct rev_info *revs,
2737
2737
if (!(obj -> flags & UNINTERESTING ))
2738
2738
continue ;
2739
2739
obj = deref_tag (revs -> repo , obj , NULL , 0 );
2740
- if (obj -> type != OBJ_COMMIT )
2740
+ if (! obj || obj -> type != OBJ_COMMIT )
2741
2741
die ("Non commit %s?" , revs -> pending .objects [i ].name );
2742
2742
if (found )
2743
2743
die ("More than one commit to dig up from, %s and %s?" ,
0 commit comments