Skip to content

Commit 6ca8cf5

Browse files
committed
better type safety before looping through mapbox subplots
1 parent b66492d commit 6ca8cf5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inst/htmlwidgets/plotly.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ HTMLWidgets.widget({
199199
// https://www.mapbox.com/mapbox-gl-js/example/fitbounds/
200200
// so we do this manually...
201201
// TODO: make sure this triggers on a redraw and relayout as well as on initial draw
202-
var mapboxIDs = graphDiv._fullLayout._subplots.mapbox;
202+
var mapboxIDs = graphDiv._fullLayout._subplots.mapbox || [];
203203
for (var i = 0; i < mapboxIDs.length; i++) {
204204
var id = mapboxIDs[i];
205205
var mapOpts = x.layout[id] || {};

0 commit comments

Comments
 (0)