Skip to content

Commit

Permalink
Slightly better error handling in -[MIKMIDISequence initWithFileAtURL…
Browse files Browse the repository at this point in the history
…:...].
  • Loading branch information
Andrew Madsen committed Mar 8, 2016
1 parent c4a9f63 commit 7671d1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/MIKMIDISequence.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ - (instancetype)initWithFileAtURL:(NSURL *)fileURL error:(NSError **)error;
- (instancetype)initWithFileAtURL:(NSURL *)fileURL convertMIDIChannelsToTracks:(BOOL)convertMIDIChannelsToTracks error:(NSError **)error
{
NSData *data = [NSData dataWithContentsOfURL:fileURL options:0 error:error];
if (!data) return nil;
return [self initWithData:data convertMIDIChannelsToTracks:convertMIDIChannelsToTracks error:error];
}

Expand All @@ -96,7 +97,7 @@ - (instancetype)initWithData:(NSData *)data error:(NSError **)error

- (instancetype)initWithData:(NSData *)data convertMIDIChannelsToTracks:(BOOL)convertMIDIChannelsToTracks error:(NSError **)error
{
error = error ? error : &(NSError *__autoreleasing){ nil };
error = error ?: &(NSError *__autoreleasing){ nil };

MusicSequence sequence;
OSStatus err = NewMusicSequence(&sequence);
Expand Down

0 comments on commit 7671d1d

Please sign in to comment.