Avoid calling substr method on undefined

Co-authored-by: Jamel Noel Reid <MrJnrman@users.noreply.github.com>
This commit is contained in:
Lucas Bustamante 2022-02-03 20:35:03 -03:00 committed by GitHub
parent 1703aeddc4
commit 1688d66484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ const args = process.argv.slice( 2 );
const command = args[0];
let packageName = null;
if (args[1].substr(0, 2) !== '--') {
if ( args[1] && args[1].substr(0, 2) !== '--') {
packageName = args[1];
}