Skip to content

Firefly III: a personal finances manager

Fix error when not-existing import job is submitted.

James Coleb23eb0701869
diff --git a/app/Console/Commands/CreateImport.php b/app/Console/Commands/CreateImport.php
index d9b51a3b6d..c42ca44a2b 100644
--- a/app/Console/Commands/CreateImport.php
+++ b/app/Console/Commands/CreateImport.php
@@ -84,7 +84,7 @@ class CreateImport extends Command
$job = $jobRepository->create($type);
$this->line(sprintf('Created job "%s"...', $job->key));
- Artisan::call('firefly:encrypt', ['file' => $file, 'key' => $job->key]);
+ Artisan::call('firefly:encrypt-file', ['file' => $file, 'key' => $job->key]);
$this->line('Stored import data...');
$job->configuration = $configurationData;
diff --git a/app/Console/Commands/Import.php b/app/Console/Commands/Import.php
index c67f39000f..91ad4b1b29 100644
--- a/app/Console/Commands/Import.php
+++ b/app/Console/Commands/Import.php
@@ -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.');