diff --git a/dist/hyperagent.js b/dist/hyperagent.js index 2d1c170..d1e8824 100644 --- a/dist/hyperagent.js +++ b/dist/hyperagent.js @@ -279,8 +279,8 @@ define("hyperagent/properties", // one large object for defineProperties first and call on that in the end // and if that would make the code cleaner. options = options || {}; - if (Object(response) !== response) { - throw new Error('The Properties argument must be an object.'); + if (!response) { + response = {}; } // Overwrite the response object with the original properties if provided. config._.defaults(response, options.original || {}); @@ -688,4 +688,4 @@ define("hyperagent/resource", __exports__.LinkResource = LinkResource; }); window.Hyperagent = requireModule('hyperagent'); -}()); \ No newline at end of file +}()); diff --git a/lib/hyperagent/properties.js b/lib/hyperagent/properties.js index 78bb0a2..92b027c 100644 --- a/lib/hyperagent/properties.js +++ b/lib/hyperagent/properties.js @@ -5,8 +5,8 @@ export function Properties(response, options) { // one large object for defineProperties first and call on that in the end // and if that would make the code cleaner. options = options || {}; - if (Object(response) !== response) { - throw new Error('The Properties argument must be an object.'); + if (!response) { + response = {}; } // Overwrite the response object with the original properties if provided. config._.defaults(response, options.original || {});