From 15bbad77dce5d50b5f781f87d4c0084ae882cae6 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Mon, 15 May 2017 19:46:18 +0100 Subject: [PATCH] Added null checks --- app/Console/Commands/ImportPonify.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/ImportPonify.php b/app/Console/Commands/ImportPonify.php index 951a0d39..fdc03794 100644 --- a/app/Console/Commands/ImportPonify.php +++ b/app/Console/Commands/ImportPonify.php @@ -471,12 +471,18 @@ class ImportPonify extends Command $track->genre_id = $genreId; $track->track_number = $parsedTags['track_number']; $track->released_at = $releasedAt; - $track->description = $parsedTags['comments']; $track->is_downloadable = true; - $track->lyrics = $parsedTags['lyrics']; $track->is_vocal = $isVocal; $track->license_id = 2; + if (!is_null($parsedTags['comments'])) { + $track->title = $parsedTags['comments']; + } + + if (!is_null($parsedTags['lyrics'])) { + $track->title = $parsedTags['lyrics']; + } + if (!is_null($parsedTags['title'])) { $track->title = $parsedTags['title']; }