Skip to content

Commit 8764e4d

Browse files
Add missing check
1 parent 0ae2831 commit 8764e4d

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/plots/cartesian/axes.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -370,20 +370,22 @@ axes.doAutoRange = function(ax) {
370370

371371
if(ax._anchorAxis && ax._anchorAxis.rangeslider) {
372372
var axeRangeOpts = ax._anchorAxis.rangeslider[ax._name];
373-
switch(axeRangeOpts.rangemode) {
374-
case 'auto':
375-
axeRangeOpts.range = hasDeps ? axes.getAutoRange(ax) : ax.range.slice();
376-
break;
377-
case 'match':
378-
axeRangeOpts.range = ax.range.slice();
379-
break;
380-
default:
381-
axeRangeOpts.range = ax.range.slice();
382-
break;
373+
if(axeRangeOpts) {
374+
switch(axeRangeOpts.rangemode) {
375+
case 'auto':
376+
axeRangeOpts.range = hasDeps ? axes.getAutoRange(ax) : ax.range.slice();
377+
break;
378+
case 'match':
379+
axeRangeOpts.range = ax.range.slice();
380+
break;
381+
default:
382+
axeRangeOpts.range = ax.range.slice();
383+
break;
384+
}
385+
axIn = ax._anchorAxis._input;
386+
axIn.rangeslider[ax._name].range = axeRangeOpts.range.slice();
387+
axIn.rangeslider[ax._name].rangemode = axeRangeOpts.rangemode;
383388
}
384-
axIn = ax._anchorAxis._input;
385-
axIn.rangeslider[ax._name].range = axeRangeOpts.range.slice();
386-
axIn.rangeslider[ax._name].rangemode = axeRangeOpts.rangemode;
387389
}
388390
};
389391

0 commit comments

Comments
 (0)