From 6bc2af6e712bf5ff91bf629637d9e3cb30be1428 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 6 Jan 2016 21:04:59 -0800 Subject: [PATCH] Fix for missing company --- app/commands/AssetImportCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/commands/AssetImportCommand.php b/app/commands/AssetImportCommand.php index ef3ab730cf..028c9ca786 100644 --- a/app/commands/AssetImportCommand.php +++ b/app/commands/AssetImportCommand.php @@ -372,6 +372,8 @@ class AssetImportCommand extends Command { } } + } else { + $company = new Company(); } // Check for the asset match and create it if it doesn't exist @@ -397,7 +399,7 @@ class AssetImportCommand extends Command { $asset->rtd_location_id = $location->id; $asset->user_id = 1; $asset->status_id = $status_id; - $asset->company_id = $company->id; + $asset->company_id = $company->id; if ($user_asset_purchase_date!='') { $asset->purchase_date = $user_asset_purchase_date; } else {