Skip to content

Commit 5373acf

Browse files
committed
Merge pull request #462 from dleehr/fix-tag-enumeration-crash
Avoid calling tag enumerator block if lookup returns nil tag
2 parents ac7be76 + 4f29c2b commit 5373acf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ObjectiveGit/GTRepository.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,9 @@ static int GTRepositoryForeachTagCallback(const char *name, git_oid *oid, void *
457457
GTTag *tag = (GTTag *)[info->myself lookUpObjectByGitOid:oid objectType:GTObjectTypeTag error:NULL];
458458

459459
BOOL stop = NO;
460-
info->block(tag, &stop);
460+
if (tag != nil) {
461+
info->block(tag, &stop);
462+
}
461463

462464
return stop ? GIT_EUSER : 0;
463465
}

0 commit comments

Comments
 (0)