BaseModel.search might return nil
This commit is contained in:
parent
6a4f9f7be4
commit
60d4df1cab
lib/musicbrainz/models
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue