Account for null or undefined geometry
The change in #2098 made it so a feature's geometry could be undefined. This is consistent with the return type for the getGeometry method. Where calling code needs to ensure that it has a geometry instance, it can use instanceof, goog.isDefAndNotNull(), or test for a truthy value.
This commit is contained in:
@@ -115,7 +115,7 @@ ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, result) {
|
||||
for (j = 0, jj = readFeatures.length; j < jj; ++j) {
|
||||
var feature = readFeatures[j];
|
||||
var geometry = feature.getGeometry();
|
||||
if (!goog.isNull(geometry)) {
|
||||
if (goog.isDefAndNotNull(geometry)) {
|
||||
geometry.applyTransform(transform);
|
||||
}
|
||||
features.push(feature);
|
||||
|
||||
Reference in New Issue
Block a user