Skip to content

A free open source IT asset/license management system

Check that the array key exists

snipe1f2d30ebf456
diff --git a/app/Http/Controllers/LabelsController.php b/app/Http/Controllers/LabelsController.php
index 4fe04dc1c5..799d910384 100755
--- a/app/Http/Controllers/LabelsController.php
+++ b/app/Http/Controllers/LabelsController.php
@@ -71,11 +71,13 @@ class LabelsController extends Controller
collect(explode(';', Setting::getSettings()->label2_fields))
->filter()
->each(function ($item) use ($customFieldColumns, $exampleAsset) {
- $pair = explode('=', $item);
-
- if ($customFieldColumns->contains($pair[1])) {
- $exampleAsset->{$pair[1]} = "{{$pair[0]}}";
- }
+ $pair = explode('=', $item);
+
+ if (array_key_exists(1, $pair)) {
+ if ($customFieldColumns->contains($pair[1])) {
+ $exampleAsset->{$pair[1]} = "{{$pair[0]}}";
+ }
+ }
});
$settings = Setting::getSettings();