From c7766d5993d1e8ba027e9741e6cf8ceb1507a030 Mon Sep 17 00:00:00 2001 From: Tom Burgin Date: Fri, 9 Aug 2024 17:17:13 -0400 Subject: [PATCH] length and count check (#1413) --- Source/common/SNTFileInfo.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/common/SNTFileInfo.m b/Source/common/SNTFileInfo.m index 0f21e3ede..ae3763b9b 100644 --- a/Source/common/SNTFileInfo.m +++ b/Source/common/SNTFileInfo.m @@ -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; }