Skip to content

Commit

Permalink
Fixed checking for empty obj.Body before further actions
Browse files Browse the repository at this point in the history
  • Loading branch information
raviolin committed Nov 9, 2017
1 parent a142aee commit ccac52d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/client.js
Expand Up @@ -393,18 +393,18 @@ Client.prototype._invoke = function(method, args, location, callback, options, e
return callback(null, null, body, obj.Header);
}

// If it's not HTML and Soap Body is empty
if (!obj.html && !obj.Body) {
return callback(null, obj, body, obj.Header);
}

if( typeof obj.Body !== 'object' ) {
var error = new Error('Cannot parse response');
error.response = response;
error.body = body;
return callback(error, obj, body);
}

// if Soap Body is empty
if (!obj.Body) {
return callback(null, obj, body, obj.Header);
}

result = obj.Body[output.$name];
// RPC/literal response body may contain elements with added suffixes I.E.
// 'Response', or 'Output', or 'Out'
Expand Down

0 comments on commit ccac52d

Please sign in to comment.