From 93ea937ced9dce7e5294d18b3e1774de64d02837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damien=20Gu=C3=A9rin?= Date: Tue, 10 Mar 2015 11:57:51 +0100 Subject: [PATCH 1/2] Update hyperagent.js --- dist/hyperagent.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 +}()); From 00ba8439490387e0b5ffff66d31324cb18cde82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damien=20Gu=C3=A9rin?= Date: Tue, 10 Mar 2015 11:58:42 +0100 Subject: [PATCH 2/2] Update properties.js --- lib/hyperagent/properties.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 || {});