From f8a1f2c23b93336c5c27793325d5f02bd8771564 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Mon, 3 Jul 2017 20:58:54 -0500 Subject: [PATCH] fix this again (#1655) --- src/util/Util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/Util.js b/src/util/Util.js index 7825b2a73..106b99ee2 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -2,6 +2,7 @@ const snekfetch = require('snekfetch'); const Constants = require('./Constants'); const ConstantsHttp = Constants.DefaultOptions.http; const { RangeError, TypeError } = require('../errors'); +const has = (o, k) => Object.prototype.hasOwnProperty.call(o, k); /** * Contains various general-purpose utility methods. These functions are also available on the base `Discord` object. @@ -128,7 +129,7 @@ class Util { static mergeDefault(def, given) { if (!given) return def; for (const key in def) { - if (!{}.hasOwnProperty.call(given, key) && def[key] !== undefined) { + if (!has(given, key) || given[key] === undefined) { given[key] = def[key]; } else if (given[key] === Object(given[key])) { given[key] = this.mergeDefault(def[key], given[key]);