Skip to content

Commit

Permalink
fix: do not display an error for an empty CSV (#2505)
Browse files Browse the repository at this point in the history
fix #577
fix #2491
fix #1546
  • Loading branch information
yohanboniface authored Feb 11, 2025
2 parents 9c418af + 8e13a15 commit c71a6aa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions umap/static/umap/js/modules/formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c71a6aa

Please sign in to comment.