From 42c8372d3862b398029a2505226458e02ac929e0 Mon Sep 17 00:00:00 2001 From: Onur Date: Tue, 24 Aug 2021 07:47:00 +0300 Subject: [PATCH] fix: errors brake batch run (#69) Co-authored-by: Onur Ozguzel --- index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 676abb6..62d4309 100644 --- a/index.js +++ b/index.js @@ -250,7 +250,7 @@ function checkBudgets(summary, options) { } } - if (options.accessibility > 0) { + if (options.accessibility > 0 && summary.detail) { const score = toScore(summary.detail.accessibility); if (score < options.accessibility) { errors.push( @@ -259,7 +259,7 @@ function checkBudgets(summary, options) { } } - if (options.performance > 0) { + if (options.performance > 0 && summary.detail) { const score = toScore(summary.detail.performance); if (score < options.performance) { errors.push( @@ -268,7 +268,7 @@ function checkBudgets(summary, options) { } } - if (options.bestPractices > 0) { + if (options.bestPractices > 0 && summary.detail) { const score = toScore(summary.detail["best-practices"]); if (score < options.bestPractices) { errors.push( @@ -277,7 +277,7 @@ function checkBudgets(summary, options) { } } - if (options.seo > 0) { + if (options.seo > 0 && summary.detail) { const score = toScore(summary.detail.seo); if (score < options.seo) { errors.push( @@ -286,7 +286,7 @@ function checkBudgets(summary, options) { } } - if (options.pwa > 0) { + if (options.pwa > 0 && summary.detail) { const score = toScore(summary.detail.pwa); if (score < options.pwa) { errors.push(