diff --git a/app/src/frontend/hooks/use-building-data.ts b/app/src/frontend/hooks/use-building-data.ts index 8b2fc295..1263f076 100644 --- a/app/src/frontend/hooks/use-building-data.ts +++ b/app/src/frontend/hooks/use-building-data.ts @@ -30,10 +30,14 @@ export function useBuildingData(buildingId: number, preloadedData: Building): [B }, [buildingId]); const updateData = useCallback((building: Building) => { - if(building.verified == undefined) { - building.verified = {} as BuildingAttributeVerificationCounts; + if(building == undefined) { + setBuildingData(building); + } else { + if(building.verified == undefined) { + building.verified = {} as BuildingAttributeVerificationCounts; + } + setBuildingData(building); } - setBuildingData(building); }, []); useEffect(() => {