diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-12-21 08:40:04 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2018-12-21 08:40:04 +0300 |
commit | 94b4c656b731e8c56b0fc51456bde61e34562d1c (patch) | |
tree | 0b76671e0491089c7ed45aed3d1224dff4dcd13f | |
parent | 4c2016ab8087e2b216b58f271e3477f14a1dd5a7 (diff) |
Prevent possible fatal error when report not found (#13892)
-rw-r--r-- | plugins/Goals/Pages.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/Goals/Pages.php b/plugins/Goals/Pages.php index b8ee1b1fd9..c9410f2807 100644 --- a/plugins/Goals/Pages.php +++ b/plugins/Goals/Pages.php @@ -295,6 +295,9 @@ class Pages } $widget = $this->createWidgetForReport($report['module'], $report['action']); + if (!$widget) { + continue; + } if (!empty($report['name'])) { $widget->setName($report['name']); } @@ -342,8 +345,10 @@ class Pages private function createWidgetForReport($module, $action) { $report = ReportsProvider::factory($module, $action); - $factory = new ReportWidgetFactory($report); - return $factory->createWidget(); + if ($report) { + $factory = new ReportWidgetFactory($report); + return $factory->createWidget(); + } } } |