When trying to deactivate a control from within that control's featureAdded

event, a null exception is encountered. A null check fixes this bug. (Closes
#1143)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@5433 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-12-15 21:29:06 +00:00
parent f746ed4211
commit 7881c2099a
4 changed files with 22 additions and 5 deletions

View File

@@ -65,7 +65,9 @@ OpenLayers.Handler.Polygon = OpenLayers.Class(OpenLayers.Handler.Path, {
*/
destroyFeature: function() {
OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);
this.polygon.destroy();
if(this.polygon) {
this.polygon.destroy();
}
this.polygon = null;
},