fix: Check for package.json name first (#805)

pull/766/merge v9.60.1
Rhys Arkins 2017-09-14 13:56:09 +02:00 committed by singapore
parent 5040862604
commit 60f54f8a5a
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ async function writeExistingFiles(config) {
logger.debug(`Writing package.json to ${basedir}`);
// Massage the file to eliminate yarn errors
const massagedFile = { ...packageFile.content };
if (!massagedFile.name.match(/^[0-9a-z-_]+$/)) {
if (massagedFile.name && !massagedFile.name.match(/^[0-9a-z-_]+$/)) {
massagedFile.name = 'dummy';
}
delete massagedFile.engines;