Assert that feature.get('foo') returns a geometry

This commit is contained in:
Andreas Hocevar
2014-12-18 10:08:35 +01:00
parent 19015d2ca9
commit 2bf191b5e3

View File

@@ -138,8 +138,9 @@ ol.style.Style.prototype.setGeometry = function(geometry) {
} else if (goog.isString(geometry)) {
this.geometryFunction_ = function(feature) {
var result = feature.get(geometry);
goog.asserts.assert(!goog.isDefAndNotNull(result) ||
goog.asserts.assertInstanceof(result, ol.geom.Geometry));
if (goog.isDefAndNotNull(result)) {
goog.asserts.assertInstanceof(result, ol.geom.Geometry);
}
return result;
};
} else if (goog.isDef(geometry)) {