@@ -108,16 +108,18 @@ var parseValues = function parseQueryStringValues(str, options) {
108
108
} else {
109
109
key = options . decoder ( part . slice ( 0 , pos ) , defaults . decoder , charset , 'key' ) ;
110
110
111
- val = utils . maybeMap (
112
- parseArrayValue (
113
- part . slice ( pos + 1 ) ,
114
- options ,
115
- isArray ( obj [ key ] ) ? obj [ key ] . length : 0
116
- ) ,
117
- function ( encodedVal ) {
118
- return options . decoder ( encodedVal , defaults . decoder , charset , 'value' ) ;
119
- }
120
- ) ;
111
+ if ( key !== null ) {
112
+ val = utils . maybeMap (
113
+ parseArrayValue (
114
+ part . slice ( pos + 1 ) ,
115
+ options ,
116
+ isArray ( obj [ key ] ) ? obj [ key ] . length : 0
117
+ ) ,
118
+ function ( encodedVal ) {
119
+ return options . decoder ( encodedVal , defaults . decoder , charset , 'value' ) ;
120
+ }
121
+ ) ;
122
+ }
121
123
}
122
124
123
125
if ( val && options . interpretNumericEntities && charset === 'iso-8859-1' ) {
@@ -128,11 +130,13 @@ var parseValues = function parseQueryStringValues(str, options) {
128
130
val = isArray ( val ) ? [ val ] : val ;
129
131
}
130
132
131
- var existing = has . call ( obj , key ) ;
132
- if ( existing && options . duplicates === 'combine' ) {
133
- obj [ key ] = utils . combine ( obj [ key ] , val ) ;
134
- } else if ( ! existing || options . duplicates === 'last' ) {
135
- obj [ key ] = val ;
133
+ if ( key !== null ) {
134
+ var existing = has . call ( obj , key ) ;
135
+ if ( existing && options . duplicates === 'combine' ) {
136
+ obj [ key ] = utils . combine ( obj [ key ] , val ) ;
137
+ } else if ( ! existing || options . duplicates === 'last' ) {
138
+ obj [ key ] = val ;
139
+ }
136
140
}
137
141
}
138
142
0 commit comments