Skip to content

Commit 2fd95b6

Browse files
authored
Merge pull request #2108 from WordPress/fix/od-debug-mode-without-groups
Avoid possible error when reading groups in debug mode
2 parents 85001b9 + fb6f0cc commit 2fd95b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/optimization-detective/detect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ export default async function detect( {
555555
const { log, warn, error } = logger;
556556
compressionEnabled = gzdecodeAvailable;
557557

558-
if ( isDebug ) {
558+
if ( isDebug && Array.isArray( urlMetricGroupCollection?.groups ) ) {
559559
const allUrlMetrics = /** @type Array<UrlMetricDebugData> */ [];
560560
for ( const group of urlMetricGroupCollection.groups ) {
561561
for ( const otherUrlMetric of group.url_metrics ) {

0 commit comments

Comments
 (0)