Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit 67700d3

Browse files
committed
more places to check
1 parent 7729bb2 commit 67700d3

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

lib/projectBuilder.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ function createApps(w3cManifestInfo, rootDir, platforms, options, href, callback
115115
}
116116
}
117117

118+
if (!w3cManifestInfo || !w3cManifestInfo.content) {
119+
return Q.reject(new Error("missing manifest information")).nodeify(callback);
120+
}
121+
118122
if (!href) {
119123
href = '/';
120124
}

lib/validations.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
'use strict';
22

33
var platformTools = require('./platformTools'),
44
manifestTools = require('./manifestTools');
@@ -36,7 +36,11 @@ function manifestFormatValid(format) {
3636
}
3737

3838
function isExpectedValidationError(errorResult) {
39-
const checkForPurposeList = errorResult.member.includes("icons") && errorResult.member.includes("purpose")
39+
if (!errorResult.member) {
40+
return false;
41+
}
42+
43+
const checkForPurposeList = errorResult.member.includes("icons") && errorResult.member.includes("purpose");
4044

4145
return checkForPurposeList
4246
}
@@ -46,7 +50,7 @@ function isExpectedCase(errorResult, w3cManifestInfo) {
4650
return true;
4751
}
4852

49-
const errorParams = errorResult.member.split('/').slice(1) //example: /icons/0/purpose -> ['icons', '0', 'purpose']
53+
const errorParams = errorResult.member.split('/').slice(1); //example: /icons/0/purpose -> ['icons', '0', 'purpose']
5054
const isIconsPurpose = errorResult.member.includes("icons") && errorResult.member.includes("purpose");
5155
const isShortcuts = errorResult.member.includes("shortcuts");
5256
const isScreenshots = errorResult.member.includes("screenshots"); // in the case we need to extend it to screenshots as well...
@@ -56,7 +60,7 @@ function isExpectedCase(errorResult, w3cManifestInfo) {
5660
return true;
5761

5862
} else if (isIconsPurpose) {
59-
const [icons, index, purpose] = errorParams
63+
const [icons, index, purpose] = errorParams;
6064

6165
return w3cManifestInfo.content.icons
6266
&& w3cManifestInfo.content.icons[index]

0 commit comments

Comments
 (0)