Skip to content

Commit

Permalink
Removing zoom control causes crash if it has already been removed pri…
Browse files Browse the repository at this point in the history
…or. Wrap in try/catch to fix. (#14182)
  • Loading branch information
Jefferson Rabb authored Dec 11, 2019
1 parent 9a9c1a4 commit 2cf820b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extensions/blocks/map/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ export class Map extends Component {
},
} );
this.setState( { boundsSetProgrammatically: true } );
map.removeControl( zoomControl );
try {
map.removeControl( zoomControl );
} catch ( e ) {}
return;
}
// If there is only one point, center map around it.
Expand Down

0 comments on commit 2cf820b

Please sign in to comment.