* fix potential null problems

This commit is contained in:
Reinhard Pointner 2012-12-16 13:46:06 +00:00
parent 8052c400cd
commit e090e76afd
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ def fetchMovieArtwork(outputFile, movieInfo, category, language) {
def fetchAllMovieArtwork(outputFolder, movieInfo, category, language) {
// select and fetch artwork
def artwork = TheMovieDB.getArtwork(movieInfo.id as String)
def selection = [language, 'en', null].findResults{ l -> artwork.findAll{ (l == it.language || l == null) && it.category == category } }.flatten().unique()
def selection = [language, 'en', null].findResults{ l -> artwork.findAll{ (l == it.language || l == null) && it.category == category } }.flatten().findAll{ it?.url }.unique()
if (selection == null) {
println "Artwork not found: $outputFolder"
return null