Avoid calling substr method on undefined
Co-authored-by: Jamel Noel Reid <MrJnrman@users.noreply.github.com>
This commit is contained in:
parent
1703aeddc4
commit
1688d66484
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue