From 7bb2cd395d9574233a0605d817f73fc883c6fd77 Mon Sep 17 00:00:00 2001 From: Jeroen Dalsem Date: Fri, 17 Nov 2023 16:27:45 +0100 Subject: [PATCH] chore: check if a user agent is present to prevent exceptions --- classes/ColdTrick/WidgetManager/WidgetsSettingsConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/ColdTrick/WidgetManager/WidgetsSettingsConfig.php b/classes/ColdTrick/WidgetManager/WidgetsSettingsConfig.php index 15ae690..79c9782 100644 --- a/classes/ColdTrick/WidgetManager/WidgetsSettingsConfig.php +++ b/classes/ColdTrick/WidgetManager/WidgetsSettingsConfig.php @@ -169,7 +169,7 @@ public function showLazyLoaded(\WidgetManagerWidget $widget, array $layout_info if ($widget->column < $first_column_with_data) { $mobile_detect = new \Detection\MobileDetect(); - if ($mobile_detect->isMobile()) { + if ($mobile_detect->hasUserAgent() && $mobile_detect->isMobile()) { return true; } }