Skip to content

Commit

Permalink
Patch to fix destroy() being called on an undefined object
Browse files Browse the repository at this point in the history
  • Loading branch information
dracic committed Dec 19, 2015
1 parent 36c1e5f commit 6ff7f22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/OpenLayers/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,9 @@ OpenLayers.Map = OpenLayers.Class({

if (this.controls != null) {
for (var i = this.controls.length - 1; i>=0; --i) {
this.controls[i].destroy();
if(this.controls[i] != undefined) {
this.controls[i].destroy();
}
}
this.controls = null;
}
Expand Down

0 comments on commit 6ff7f22

Please sign in to comment.