Skip to content

Commit dee879e

Browse files
committed
Patch to fix destroy() being called on an undefined object
heron-mc/heron-mc#399
1 parent 1e1bd1b commit dee879e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/OpenLayers/Map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,9 @@ OpenLayers.Map = OpenLayers.Class({
816816

817817
if (this.controls != null) {
818818
for (var i = this.controls.length - 1; i>=0; --i) {
819-
this.controls[i].destroy();
819+
if(this.controls[i] != undefined) {
820+
this.controls[i].destroy();
821+
}
820822
}
821823
this.controls = null;
822824
}

0 commit comments

Comments
 (0)