1
0
Fork 0

Merge pull request #24 from oleander/nil_result

BaseModel.search might return nil
This commit is contained in:
Mathias Gawlista 2014-02-05 14:29:36 +01:00
commit 35b32bddf4
1 changed files with 3 additions and 1 deletions

View File

@ -36,7 +36,9 @@ module MusicBrainz
def find_by_name(name)
matches = search(name)
matches.empty? ? nil : find(matches.first[:id])
if matches and not matches.empty?
find(matches.first[:id])
end
end
end
end