Skip to content

Commit

Permalink
length and count check (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
tburgin authored Aug 9, 2024
1 parent 341abf0 commit c7766d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/common/SNTFileInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,12 @@ - (NSDictionary *)infoPlist {
// `-[NSDictionary infoDictionary]` is heavily cached, changes to the Info.plist are not
// realized. Use `CFBundleCopyInfoDictionaryInDirectory` instead, which does not appear to
// cache.
d = CFBridgingRelease(CFBundleCopyInfoDictionaryInDirectory(
(__bridge CFURLRef)[NSURL fileURLWithPath:[self bundlePath]]));
if (d) {
NSString *bundlePath = [self bundlePath];
if (bundlePath.length) {
d = CFBridgingRelease(CFBundleCopyInfoDictionaryInDirectory(
(__bridge CFURLRef)[NSURL fileURLWithPath:bundlePath]));
}
if (d.count) {
self.infoDict = d;
return self.infoDict;
}
Expand Down

0 comments on commit c7766d5

Please sign in to comment.