Skip to content

Commit fe7904a

Browse files
committed
Fixes unchecked access to 'deploy' script on build
1 parent c03bb36 commit fe7904a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/react-dev-utils/printHostingInstructions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ function printHostingInstructions(
2222
if (publicUrl && publicUrl.includes('.github.io/')) {
2323
// "homepage": "http://user.github.io/project"
2424
const publicPathname = url.parse(publicPath).pathname;
25-
const hasDeployScript = typeof appPackage.scripts.deploy !== 'undefined';
25+
const hasDeployScript =
26+
typeof appPackage.scripts !== 'undefined' &&
27+
typeof appPackage.scripts.deploy !== 'undefined';
2628
printBaseMessage(buildFolder, publicPathname);
2729

2830
printDeployInstructions(publicUrl, hasDeployScript, useYarn);

0 commit comments

Comments
 (0)