Fix strict mode issues

pull/28217/head
Johannes Marbach 2023-02-13 20:25:43 +01:00
parent d0e9331f07
commit de864f15bc
1 changed files with 2 additions and 2 deletions

View File

@ -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;