Fixed: Info.plist file with just whitespaces is not treated as an empty file in Node. Trim it and check length.

This commit is contained in:
Martin Carlberg committed 2021-08-27 09:08:19 +02:00
1 parent a2337a2969
commit 251ce7fdad
1 file changed
+7 -3
+7 -3
View File
@@ -976,10 +976,14 @@ var /* FILE = require("file"), */
if (!plist)
[self failWithMessage:@"Could not read the Info.plist at: " + configPath];
plist = CFPropertyList.propertyListFromString(plist);
if (plist.trim().length > 0) {
plist = CFPropertyList.propertyListFromString(plist);
if (!plist)
[self failWithMessage:@"Could not parse the Info.plist at: " + configPath];
if (!plist)
[self failWithMessage:@"Could not parse the Info.plist at: " + configPath];
} else {
plist = nil;
}
}
return {path: configPath, plist: plist};