From 2bf191b5e3804b5362ee775ee04cc79807c0692f Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Thu, 18 Dec 2014 10:08:35 +0100 Subject: [PATCH] Assert that feature.get('foo') returns a geometry --- src/ol/style/style.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ol/style/style.js b/src/ol/style/style.js index 8ea5cdc272..5aa4421765 100644 --- a/src/ol/style/style.js +++ b/src/ol/style/style.js @@ -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)) {