From 302e7f802b5fee298917ceefee1fdf48d0724a6b Mon Sep 17 00:00:00 2001 From: Patrick Machielse Date: Wed, 6 Nov 2024 17:07:36 +0100 Subject: [PATCH] Fixed nullability issues. --- Source/MIKMIDIMapping.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/MIKMIDIMapping.m b/Source/MIKMIDIMapping.m index a42e10a8..45d70e4d 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