diff --git a/lib/musicbrainz/models/release_group.rb b/lib/musicbrainz/models/release_group.rb index 2129830..66062c2 100644 --- a/lib/musicbrainz/models/release_group.rb +++ b/lib/musicbrainz/models/release_group.rb @@ -35,7 +35,7 @@ module MusicBrainz def find_by_artist_and_title(artist_name, title, type = nil ) matches = search(artist_name, title, type) - matches.empty? ? nil : find(matches.first[:id]) + matches.nil? || matches.empty? ? nil : find(matches.first[:id]) end end end