Skip to content

Commit

Permalink
Fixed nullability issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMIK committed Nov 6, 2024
1 parent ca6cbe4 commit 302e7f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/MIKMIDIMapping.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -471,4 +471,4 @@ - (instancetype)initWithFileAtURL:(NSURL *)url
return [self initWithFileAtURL:url error:NULL];
}

@end
@end

0 comments on commit 302e7f8

Please sign in to comment.