From f5ce88789e70c1b68b1abe38a3dcda2c14576eb8 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 13 Jan 2014 10:26:19 +0100 Subject: [PATCH] Use goog.isNull in if statements --- src/ol/interaction/drawinteraction.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/interaction/drawinteraction.js b/src/ol/interaction/drawinteraction.js index c36d0116d5..61593a47e6 100644 --- a/src/ol/interaction/drawinteraction.js +++ b/src/ol/interaction/drawinteraction.js @@ -265,7 +265,7 @@ ol.interaction.Draw.prototype.handleMove_ = function(event) { */ ol.interaction.Draw.prototype.atFinish_ = function(event) { var at = false; - if (this.sketchFeature_) { + if (!goog.isNull(this.sketchFeature_)) { var geometry = this.sketchFeature_.getGeometry(); var potentiallyDone = false; if (this.mode_ === ol.interaction.DrawMode.LINE_STRING) { @@ -424,7 +424,7 @@ ol.interaction.Draw.prototype.finishDrawing_ = function(event) { sketchFeature.setGeometry(new ol.geom.MultiPolygon([coordinates])); } - if (this.layer_) { + if (!goog.isNull(this.layer_)) { this.layer_.getSource().addFeature(sketchFeature); } }; @@ -454,10 +454,10 @@ ol.interaction.Draw.prototype.abortDrawing_ = function() { */ ol.interaction.Draw.prototype.updateSketchFeatures_ = function() { var sketchFeatures = [this.sketchFeature_]; - if (this.sketchLine_) { + if (!goog.isNull(this.sketchLine_)) { sketchFeatures.push(this.sketchLine_); } - if (this.sketchPoint_) { + if (!goog.isNull(this.sketchPoint_)) { sketchFeatures.push(this.sketchPoint_); } this.overlay_.setFeatures(new ol.Collection(sketchFeatures));