Skip to content

Commit 2cf820b

Browse files
author
Jefferson Rabb
authored
Removing zoom control causes crash if it has already been removed prior. Wrap in try/catch to fix. (#14182)
1 parent 9a9c1a4 commit 2cf820b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/blocks/map/component.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ export class Map extends Component {
210210
},
211211
} );
212212
this.setState( { boundsSetProgrammatically: true } );
213-
map.removeControl( zoomControl );
213+
try {
214+
map.removeControl( zoomControl );
215+
} catch ( e ) {}
214216
return;
215217
}
216218
// If there is only one point, center map around it.

0 commit comments

Comments
 (0)