1
0
Fork 0

BaseModel.search might return nil

This commit is contained in:
Mathias Gawlista 2014-12-01 11:35:39 +01:00
parent 6a4f9f7be4
commit 60d4df1cab
1 changed files with 1 additions and 1 deletions

View File

@ -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