diff --git a/plugins/optimization-detective/detect.js b/plugins/optimization-detective/detect.js index 082a3d6f90..ad72c15b2c 100644 --- a/plugins/optimization-detective/detect.js +++ b/plugins/optimization-detective/detect.js @@ -555,7 +555,7 @@ export default async function detect( { const { log, warn, error } = logger; compressionEnabled = gzdecodeAvailable; - if ( isDebug ) { + if ( isDebug && Array.isArray( urlMetricGroupCollection?.groups ) ) { const allUrlMetrics = /** @type Array */ []; for ( const group of urlMetricGroupCollection.groups ) { for ( const otherUrlMetric of group.url_metrics ) {