HTTP In node: Check credentials exist before using

This commit is contained in:
Nick O'Leary 2014-07-22 11:33:52 +01:00
parent 0b308deb79
commit bead24e760
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ module.exports = function(RED) {
opts.headers[v.toLowerCase()] = msg.headers[v];
}
}
if (this.credentials.user) {
if (this.credentials && this.credentials.user) {
opts.auth = this.credentials.user+":"+(this.credentials.password||"");
}
var payload = null;