File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -479,7 +479,7 @@ function parse (args, opts) {
479479 // if the value is an inner object and we have dot-notation
480480 // enabled, treat inner objects in config the same as
481481 // heavily nested dot notations (foo.bar.apple).
482- if ( typeof value === 'object' && ! Array . isArray ( value ) && configuration [ 'dot-notation' ] ) {
482+ if ( typeof value === 'object' && value !== null && ! Array . isArray ( value ) && configuration [ 'dot-notation' ] ) {
483483 // if the value is an object but not an array, check nested object
484484 setConfigObject ( value , fullKey )
485485 } else {
Original file line number Diff line number Diff line change @@ -642,13 +642,15 @@ describe('yargs-parser', function () {
642642 configObjects : [ {
643643 apple : 'apple' ,
644644 banana : 42 ,
645- foo : 'baz'
645+ foo : 'baz' ,
646+ gotcha : null
646647 } ]
647648 } )
648649
649650 argv . should . have . property ( 'apple' , 'apple' )
650651 argv . should . have . property ( 'banana' , 42 )
651652 argv . should . have . property ( 'foo' , 'bar' )
653+ argv . should . have . property ( 'gotcha' , null )
652654 } )
653655
654656 it ( 'should use value from config object, if argv value is using default value' , function ( ) {
You can’t perform that action at this time.
0 commit comments