From fb6caa35ff2b9b6db571e8df577021cbb30a888c Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 23 Aug 2017 14:07:01 -0700 Subject: [PATCH] Only increment if settings table has a value (This should only ever come up in the CI tests) --- app/Observers/AssetObserver.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Observers/AssetObserver.php b/app/Observers/AssetObserver.php index 2046f0e335..801190d176 100644 --- a/app/Observers/AssetObserver.php +++ b/app/Observers/AssetObserver.php @@ -43,8 +43,9 @@ class AssetObserver */ public function created(Asset $asset) { - $settings = Setting::first(); - $settings->increment('next_auto_tag_base'); + if ($settings = Setting::first()) { + $settings->increment('next_auto_tag_base'); + } $logAction = new Actionlog(); $logAction->item_type = Asset::class;