From 296d0ee067af9c9e46c7cb14d88548f65928b706 Mon Sep 17 00:00:00 2001 From: "Stephen F. Booth" Date: Thu, 27 Feb 2020 06:54:05 -0600 Subject: [PATCH] Check for empty MB results --- CompactDisc/CompactDiscDocument.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CompactDisc/CompactDiscDocument.m b/CompactDisc/CompactDiscDocument.m index d0ac341c..d331d5c1 100644 --- a/CompactDisc/CompactDiscDocument.m +++ b/CompactDisc/CompactDiscDocument.m @@ -506,8 +506,11 @@ - (IBAction) queryMusicBrainz:(id)sender return; PerformMusicBrainzQuery([[self disc] discID], ^(NSArray *results) { + if(0 == [results count]) { + return; + } // If only match was found, update ourselves - if(1 == [results count]) { + else if(1 == [results count]) { NSDictionary *release = [results firstObject]; [self updateMetadataFromMusicBrainz:release]; NSString *releaseID = [release objectForKey:@"albumId"]; @@ -558,7 +561,6 @@ - (IBAction) toggleMetadataInspectorPanel:(id)sender else { [_metadataPanel orderOut:sender]; } - } - (IBAction) selectNextTrack:(id)sender { [_trackController selectNext:sender]; }