null should be converted into {} in deepcopy - fixes turning on/off highlightSeriesOpts
authorBeda Kosata <bedrich.kosata@nic.cz>
Thu, 26 Apr 2012 12:22:52 +0000 (14:22 +0200)
committerBeda Kosata <bedrich.kosata@nic.cz>
Thu, 26 Apr 2012 12:25:01 +0000 (14:25 +0200)
dygraph-utils.js

index f5440c7..63411a5 100644 (file)
@@ -598,7 +598,7 @@ Dygraph.updateDeep = function (self, o) {
           // DOM objects are shallowly-copied.
           self[k] = o[k];
         } else if (typeof(o[k]) == 'object') {
-          if (typeof(self[k]) != 'object') {
+          if (typeof(self[k]) != 'object' || self[k] === null) {
             self[k] = {};
           }
           Dygraph.updateDeep(self[k], o[k]);