From fe7904ae59a197868870bbea9b311ffa5d762494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Renato=20B=C3=B6hler?= Date: Wed, 8 Jan 2020 00:48:37 -0300 Subject: [PATCH] Fixes unchecked access to 'deploy' script on build --- packages/react-dev-utils/printHostingInstructions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-dev-utils/printHostingInstructions.js b/packages/react-dev-utils/printHostingInstructions.js index 9d40f66ac6a..625e9911150 100644 --- a/packages/react-dev-utils/printHostingInstructions.js +++ b/packages/react-dev-utils/printHostingInstructions.js @@ -22,7 +22,9 @@ function printHostingInstructions( if (publicUrl && publicUrl.includes('.github.io/')) { // "homepage": "http://user.github.io/project" const publicPathname = url.parse(publicPath).pathname; - const hasDeployScript = typeof appPackage.scripts.deploy !== 'undefined'; + const hasDeployScript = + typeof appPackage.scripts !== 'undefined' && + typeof appPackage.scripts.deploy !== 'undefined'; printBaseMessage(buildFolder, publicPathname); printDeployInstructions(publicUrl, hasDeployScript, useYarn);