diff --git a/src/utils.js b/src/utils.js index d57ab7761b..29734d829b 100644 --- a/src/utils.js +++ b/src/utils.js @@ -210,6 +210,8 @@ export function isObject(thing) { } export function mergeObjects(obj1, obj2, concatArrays = false) { + obj1 = obj1 instanceof Object ? obj1 : {}; + obj2 = obj2 instanceof Object ? obj2 : {}; // Recursively merge deeply nested objects. var acc = Object.assign({}, obj1); // Prevent mutation of source object. return Object.keys(obj2).reduce((acc, key) => {