Skip to content

Commit

Permalink
support in geometries: update the condition
Browse files Browse the repository at this point in the history
'We make the check a tiny bit more torough to avoid some potential crashes down the line
  • Loading branch information
ltkum committed Oct 28, 2024
1 parent 6b5e7cf commit c817c7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/VectorEncoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default class VectorEncoder {
// In some cases, the geometries are objects, in other cases they're features.
// We need to make sure that either the geometry is an object, or that the feature it contains returns
// a non-null / non-undefined value.
if (geometry && ((geometry instanceof Object && typeof geometry === 'object') || geometry(feature))) {
if (geometry && ((typeof geometry === 'object' && geometry instanceof Object) || (typeof geometry === 'function' && geometry(feature))) {
const styledFeature = feature.clone();
if (geometry instanceof Object && typeof geometry === 'object') {
styledFeature.setGeometry(geometry);
Expand Down

0 comments on commit c817c7e

Please sign in to comment.