From 48a87aa52fe927c62df0f5c86cc6a5c9e4b8b5e5 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 2 Sep 2024 10:27:53 +0200 Subject: [PATCH] Fix errors in script --- scripts/osm2pgsql/osmPoiDatabase.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/osm2pgsql/osmPoiDatabase.ts b/scripts/osm2pgsql/osmPoiDatabase.ts index 02a999d7e..cb7159e9c 100644 --- a/scripts/osm2pgsql/osmPoiDatabase.ts +++ b/scripts/osm2pgsql/osmPoiDatabase.ts @@ -94,7 +94,7 @@ export class OsmPoiDatabase { let latestDate: Date = undefined for (const name of dbs) { const date = new Date(name) - if (latestDate.getTime() < date.getTime()) { + if (latestDate === undefined || latestDate.getTime() < date.getTime()) { latest = name latestDate = date } @@ -104,7 +104,7 @@ export class OsmPoiDatabase { } console.log("Latest database is:", latest) - return latest + return "osm-poi."+latest } async createNew(date: string) {