Skip to content

Commit

Permalink
length and count check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Burgin committed Aug 9, 2024
1 parent 341abf0 commit 14fdf5b
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 14fdf5b

Please sign in to comment.