diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index 420a52a88ace..a43f1c983ad4 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -327,7 +327,7 @@ public function getReportMetadataEnd(&$reports, $info) continue; } - if (empty($apiReportToUpdate)) { // TODO: remove after done debugging + if (!is_array($apiReportToUpdate)) { // TODO: remove after done debugging throw new \Exception("found empty report at $index"); } @@ -410,6 +410,9 @@ public function getReportMetadataEnd(&$reports, $info) foreach ($extraProcessedMetrics as $metric) { $name = $metric->getName(); + if (!is_array($apiReportToUpdate)) { // TODO: remove after done debugging + throw new \Exception("2 found empty report at $index"); + } $apiReportToUpdate['processedMetrics'][$name] = $metric->getTranslatedName(); $apiReportToUpdate['metricTypes'][$name] = $metric->getSemanticType() ?: 'unspecified'; $apiReportToUpdate['processedMetricFormulas'][$name] = $metric->getFormula();