Skip to content

Commit

Permalink
Fixed POITypeIcon enum check
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam Boddin committed Sep 14, 2023
1 parent 9136f62 commit 70df23e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Server/src/routes/init.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ export class InitRoute {
continue
}
// Check if the icon number is a member of the enum.
if (!(poiIcon in POITypeIcon)) {
if (!(poiIcon in POITypeIcon.enum)) {
logger.warn(`Icon of type with id ${type.uid} is ${poiIcon}, not one of the known icons.`)
}
// ensure that the app always gets an enum member.
const appType: z.infer<typeof POITypeIcon> = poiIcon in POITypeIcon ? poiIcon : POITypeIconEnum.Generic
const appType: z.infer<typeof POITypeIcon> = poiIcon in POITypeIcon.enum ? poiIcon : POITypeIconEnum.Generic

const geoJsonPos: Feature<Point> | null = GeoJSONUtils.parseGeoJSONFeaturePoint(poi.position)
if (!geoJsonPos) {
Expand Down

0 comments on commit 70df23e

Please sign in to comment.