From 8e13a15645d145a0e1a47c3382ae179715df9341 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 11 Feb 2025 13:45:40 +0100 Subject: [PATCH] fix: do not display an error for an empty CSV fix #577 fix #2491 fix #1546 --- umap/static/umap/js/modules/formatter.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/modules/formatter.js b/umap/static/umap/js/modules/formatter.js index 314bf3916..58544a160 100644 --- a/umap/static/umap/js/modules/formatter.js +++ b/umap/static/umap/js/modules/formatter.js @@ -103,8 +103,12 @@ export class Formatter { message: err[0].message, }) } - Alert.error(message, 10000) - console.debug(err) + if (str.split(/\r\n|\r|\n/).length <= 2) { + // Seems like a blank CSV, let's not warn + console.debug(err) + } else { + Alert.error(message, 10000) + } } if (result?.features.length) { callback(result)