diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php
index 6c3cafa73a0e..94a36c88b9c2 100644
--- a/app/Utils/HtmlEngine.php
+++ b/app/Utils/HtmlEngine.php
@@ -501,7 +501,9 @@ class HtmlEngine
if ($custom_fields && property_exists($custom_fields, $field)) {
$custom_field = $custom_fields->{$field};
$custom_field_parts = explode('|', $custom_field);
- $custom_field = $custom_field_parts[1];
+
+ if(count($custom_field_parts) >= 2)
+ $custom_field = $custom_field_parts[1];
}
switch ($custom_field) {
@@ -510,7 +512,7 @@ class HtmlEngine
break;
default:
- return $value;
+ return is_null($value) ? '' : $value;
break;
}
}