Skip to content

Commit bca6cb9

Browse files
committed
fixed(core): prevent provider.search() errors when called with {id: undefined}
Signed-off-by: Tim Deubler <tim.deubler@here.com>
1 parent e2ffbb2 commit bca6cb9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

packages/core/src/providers/FeatureProvider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,10 @@ export class FeatureProvider extends Provider {
509509
searchBBox = [bbox['minLon'], bbox['minLat'], bbox['maxLon'], bbox['maxLat']];
510510
} else if (geo = bbox['point'] || bbox['rect'] || bbox['viewport']) {
511511
return provider.search(geo, options);
512-
} else if (bbox['id'] || bbox['ids']) {
513-
return provider.getFeatures(
514-
bbox['id'] || bbox['ids']
515-
);
512+
} else if ('id' in bbox) {
513+
return provider.getFeatures(bbox['id']);
514+
} else if ('ids' in bbox) {
515+
return provider.getFeatures(bbox['ids']);
516516
}
517517

518518
searchBBox = {

packages/core/src/providers/RemoteTileProvider/EditableRemoteTileProvider.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,10 @@ export abstract class EditableRemoteTileProvider extends EditableFeatureProvider
635635
searchBBox = [bbox['minLon'], bbox['minLat'], bbox['maxLon'], bbox['maxLat']];
636636
} else if (geo = bbox['point'] || bbox['rect'] || bbox['viewport']) {
637637
return provider.search(geo, options);
638-
} else if (bbox['id'] || bbox['ids']) {
639-
return provider.getFeatures(
640-
bbox['id'] || bbox['ids'],
641-
options
642-
);
638+
} else if ('id' in bbox) {
639+
return provider.getFeatures(bbox['id'], options);
640+
} else if ('ids' in bbox) {
641+
return provider.getFeatures(bbox['ids'], options);
643642
}
644643

645644
searchBBox = {

0 commit comments

Comments
 (0)