]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Forgot that `typeof null === 'object'` 1187/head
authorEvert Timberg <evert.timberg@gmail.com>
Tue, 9 Jun 2015 22:43:33 +0000 (18:43 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Tue, 9 Jun 2015 22:43:33 +0000 (18:43 -0400)
Added a check for this condition so that merge works correctly

src/Chart.Core.js

index 8034efabff04ae84fa974a9e233cbf3672f9b2af..fac8424b8873ac24dfa64f8a9501c085140c950a 100755 (executable)
                                     baseArray.push(valueObj); // nothing to merge
                                 }
                             });
-                        } else if (base.hasOwnProperty(key) && typeof base[key] == "object" && typeof value == "object") {
+                        } else if (base.hasOwnProperty(key) && typeof base[key] == "object" && base[key] !== null && typeof value == "object") {
                             // If we are overwriting an object with an object, do a merge of the properties.
                             base[key] = helpers.configMerge(base[key], value);
                         } else {