Skip to content

Commit 885501d

Browse files
committed
Merge branch 'master' into prop_types
# Conflicts: # CHANGELOG.md
2 parents b9249d0 + de3d767 commit 885501d

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 1.0.1 Release
2+
- Fix bug in componentWillUnmount->safeRemoveLayer where getPanes doesn't return anything so .contains is called on undefined.
23
- Fixed warning "Accessing PropTypes via the main React package is deprecated"
34

45
# 1.0.0 Release

lib/HeatmapLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function safeRemoveLayer(leafletMap, el) {
6868
var _leafletMap$getPanes = leafletMap.getPanes(),
6969
overlayPane = _leafletMap$getPanes.overlayPane;
7070

71-
if (overlayPane.contains(el)) {
71+
if (overlayPane && overlayPane.contains(el)) {
7272
overlayPane.removeChild(el);
7373
}
7474
}

src/HeatmapLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function isInvalidLatLngArray(arr: Array<number>): boolean {
6565

6666
function safeRemoveLayer(leafletMap: Map, el): void {
6767
const { overlayPane } = leafletMap.getPanes();
68-
if (overlayPane.contains(el)) {
68+
if (overlayPane && overlayPane.contains(el)) {
6969
overlayPane.removeChild(el);
7070
}
7171
}

0 commit comments

Comments
 (0)