diff --git a/Source/MIKMIDIMapping.m b/Source/MIKMIDIMapping.m index a42e10a..45d70e4 100644 --- a/Source/MIKMIDIMapping.m +++ b/Source/MIKMIDIMapping.m @@ -378,11 +378,11 @@ - (BOOL)loadPropertiesFromXMLDocument:(NSXMLDocument *)xmlDocument NSArray *nameAttributes = [mapping nodesForXPath:@"./@MappingName" error:&error]; if (!nameAttributes) NSLog(@"Unable to get name attributes from MIDI Mapping XML: %@", error); - self.name = [[nameAttributes lastObject] stringValue]; + self.name = [[nameAttributes lastObject] stringValue] ? : @""; NSArray *controllerNameAttributes = [mapping nodesForXPath:@"./@ControllerName" error:&error]; if (!controllerNameAttributes) NSLog(@"Unable to get controller name attributes from MIDI Mapping XML: %@", error); - self.controllerName = [[controllerNameAttributes lastObject] stringValue]; + self.controllerName = [[controllerNameAttributes lastObject] stringValue] ? : @""; NSArray *mappingItemElements = [mapping nodesForXPath:@"./MappingItems/MappingItem" error:&error]; if (!mappingItemElements) { @@ -471,4 +471,4 @@ - (instancetype)initWithFileAtURL:(NSURL *)url return [self initWithFileAtURL:url error:NULL]; } -@end \ No newline at end of file +@end