From b96fb595de82757a6410b4e375d5305da96ce609 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 20 Jun 2024 14:04:01 +0200 Subject: [PATCH] Fix bug: allow custom themes without icon --- src/Logic/DetermineLayout.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Logic/DetermineLayout.ts b/src/Logic/DetermineLayout.ts index 1526eacd1..dee7f59c0 100644 --- a/src/Logic/DetermineLayout.ts +++ b/src/Logic/DetermineLayout.ts @@ -170,10 +170,13 @@ export default class DetermineLayout { if (json.layers === undefined && json.tagRenderings !== undefined) { // We got fed a layer instead of a theme const layerConfig = json - const icon = Utils.NoNull( + let icon = Utils.NoNull( layerConfig.pointRendering .flatMap((pr) => pr.marker) .map((iconSpec) => { + if(!iconSpec){ + return undefined + } const icon = new TagRenderingConfig(iconSpec.icon) .render.txt if ( @@ -189,6 +192,10 @@ export default class DetermineLayout { }) ).join(";") + if(!icon){ + icon = "./assets/svg/bug.svg" + } + json = { id: json.id, description: json.description,