From a5d2df9626d3aafe840a3fc1ec977318de888d98 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 5 Feb 2026 01:35:11 +0000 Subject: [PATCH] Avoid stack trace when there are no suggestions --- html/static/js/address-or-report-suggestion.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/static/js/address-or-report-suggestion.js b/html/static/js/address-or-report-suggestion.js index 92a6098c..3f169626 100644 --- a/html/static/js/address-or-report-suggestion.js +++ b/html/static/js/address-or-report-suggestion.js @@ -91,7 +91,7 @@ class AddressOrReportInput extends HTMLElement { const response = await fetch(url); const data = await response.json(); - return data.features; + return data.features || []; } catch (error) { console.error('Error fetching geocoding suggestions:', error); return []; @@ -103,7 +103,7 @@ class AddressOrReportInput extends HTMLElement { const url = `/report/suggest?r=${text}` const response = await fetch(url); const data = await response.json(); - return data.reports; + return data.reports || []; } catch (error) { console.error("Error fetching report suggestions:", error); return [];