Skip to content

Commit 7876e83

Browse files
Don't crash if xcspec file is not found. Fixes #30.
1 parent 176d0a6 commit 7876e83

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

BuildSettingExtractor/BuildSettingInfoSource.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ - (NSDictionary *)xcspecFileBuildSettingInfoForPath:(NSString *)path {
178178
NSMutableDictionary *buildSettingInfo = [NSMutableDictionary dictionary];
179179
NSError *error = nil;
180180
NSData *plistData = [[NSData alloc] initWithContentsOfURL:fileURL];
181+
// If we can't read the file, behave like +dictionaryWithContentsOfFile: and return nil
182+
if (!plistData) {
183+
return nil;
184+
}
181185
id plist = [NSPropertyListSerialization propertyListWithData:plistData options:NSPropertyListImmutable format:nil error:&error];
182186
if ([plist isKindOfClass:[NSArray class]]) {
183187
NSArray *specs = (NSArray *)plist;

0 commit comments

Comments
 (0)