fix sonarqube issues
Sonarqube Scanner / Build and analyze (push) Successful in 57s

This commit is contained in:
Florian Zumpe
2026-09-26 21:51:37 +02:00
parent ec9c3e0119
commit b415fc2b63
5 changed files with 111 additions and 27 deletions
+3 -3
View File
@@ -530,7 +530,7 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
id,
gpx,
route: {
...(state.currentRoute || {}),
...state.currentRoute,
id,
name: values.name,
description: values.description
@@ -622,14 +622,14 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
async function saveLocalPoi(values) {
if (!Number.isFinite(values.lat) || !Number.isFinite(values.lon)) {
throw new Error('Für einen GPX-POI sind gültige Breiten- und Längengrade erforderlich.');
throw new TypeError('Für einen GPX-POI sind gültige Breiten- und Längengrade erforderlich.');
}
const currentId = Number(byId(ids.poiId).value);
const identifier = Number.isSafeInteger(currentId) ? currentId : ns.LocalRoutes.createPoiId();
const existing = state.pois.find(poi => Number(poi.id) === identifier) || state.currentPoi;
const media = await mediaFromLocalForm(existing, identifier);
const savedPoi = {
...(existing || {}),
...existing,
...values,
...media,
id: identifier,