From 44ca9ed1a53a107b66ba822e342f75300f7b5a96 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 14 Jan 2024 16:15:23 +0100 Subject: [PATCH] Fix dereferencing $tag when null --- models/Asset.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/Asset.php b/models/Asset.php index 93e77bc4..3fc9d046 100644 --- a/models/Asset.php +++ b/models/Asset.php @@ -715,7 +715,7 @@ class Asset LIMIT 1', [ 'id_asset' => $this->id_asset, - 'id_tag' => $tag->id_tag, + 'id_tag' => isset($tag) ? $tag->id_tag : null, 'date_captured' => $this->date_captured, ]); @@ -746,7 +746,7 @@ class Asset LIMIT 1', [ 'id_asset' => $this->id_asset, - 'id_tag' => $tag->id_tag, + 'id_tag' => isset($tag) ? $tag->id_tag : null, 'date_captured' => $this->date_captured, ]);