Fix a crash in select interaction default styling function when receiving a feature without geometry
This commit is contained in:
@@ -301,6 +301,9 @@ ol.interaction.Select.getDefaultStyleFunction = function() {
|
|||||||
styles[ol.geom.GeometryType.LINE_STRING]);
|
styles[ol.geom.GeometryType.LINE_STRING]);
|
||||||
|
|
||||||
return function(feature, resolution) {
|
return function(feature, resolution) {
|
||||||
|
if (!feature.getGeometry()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return styles[feature.getGeometry().getType()];
|
return styles[feature.getGeometry().getType()];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user