Fix error when not-existing import job is submitted.

This commit is contained in:
James Cole
2017-02-26 11:48:38 +01:00
parent 2116486fe0
commit b23eb07018
2 changed files with 4 additions and 1 deletions

View File

@@ -59,6 +59,9 @@ class Import extends Command
Log::debug('Start start-import command');
$jobKey = $this->argument('key');
$job = ImportJob::whereKey($jobKey)->first();
if (is_null($job)) {
$this->error(sprintf('No job found with key "%s"', $jobKey));
}
if (!$this->isValid($job)) {
Log::error('Job is not valid for some reason. Exit.');