Skip to content

Commit 51fed2a

Browse files
author
Ben Chatelain
committed
Address static analyzer warnings about potential null dereference
1 parent 216e3c7 commit 51fed2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ObjectiveGit/GTSignature.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,14 @@ - (NSString *)email {
111111
}
112112

113113
- (NSDate *)time {
114+
if (self.git_signature == NULL) return nil;
115+
114116
return [NSDate gt_dateFromGitTime:self.git_signature->when];
115117
}
116118

117119
- (NSTimeZone *)timeZone {
120+
if (self.git_signature == NULL) return nil;
121+
118122
return [NSTimeZone gt_timeZoneFromGitTime:self.git_signature->when];
119123
}
120124

0 commit comments

Comments
 (0)