Add extra assertion that feature's geometry is not null

This commit is contained in:
Tom Payne
2013-12-20 14:42:05 +01:00
parent bc36c2a366
commit 4b9451de81

View File

@@ -160,7 +160,9 @@ ol.source.Vector.prototype.forEachFeatureAtCoordinate =
function(coordinate, f, opt_obj) {
var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]];
return this.forEachFeatureInExtent(extent, function(feature) {
if (feature.getGeometry().containsCoordinate(coordinate)) {
var geometry = feature.getGeometry();
goog.asserts.assert(!goog.isNull(geometry));
if (geometry.containsCoordinate(coordinate)) {
return f.call(opt_obj, feature);
} else {
return undefined;