Skip to content
Myr

check that this.params is valid before calling hasOwnProperty

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Roman Shtylman · committed by Tj Holowaychuk · parent cf26cf7 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:lib/request.js+1 added-1 removed
138 unmodified lines
139 */140141req.param = function(name, defaultValue){142 // route params like /user/:id143 if (this.params.hasOwnProperty(name) && undefined !== this.params[name]) {143 if (this.params && this.params.hasOwnProperty(name) && undefined !== this.params[name]) {144 return this.params[name]; 145 }146 // query string params147 if (undefined !== this.query[name]) {
141 unmodified lines