From de864f15bcafd70d4e392662cc0054001a79c55a Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Mon, 13 Feb 2023 20:25:43 +0100 Subject: [PATCH] Fix strict mode issues --- src/utils/location/map.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/location/map.ts b/src/utils/location/map.ts index 8ba3d68c48..34d3d01478 100644 --- a/src/utils/location/map.ts +++ b/src/utils/location/map.ts @@ -24,7 +24,7 @@ import { parseGeoUri } from "./parseGeoUri"; import { findMapStyleUrl } from "./findMapStyleUrl"; import { LocationShareError } from "./LocationShareErrors"; -export const createMap = (interactive: boolean, bodyId: string, onError: (error: Error) => void): maplibregl.Map => { +export const createMap = (interactive: boolean, bodyId: string, onError?: (error: Error) => void): maplibregl.Map => { try { const styleUrl = findMapStyleUrl(); @@ -54,7 +54,7 @@ export const createMap = (interactive: boolean, bodyId: string, onError: (error: "Failed to load map: check map_style_url in config.json has a " + "valid URL and API key", e.error, ); - onError(new Error(LocationShareError.MapStyleUrlNotReachable)); + onError?.(new Error(LocationShareError.MapStyleUrlNotReachable)); }); return map;