From b1181f0baf2f43a6ad615884ab2a9d8b7b40febe Mon Sep 17 00:00:00 2001 From: Kai Date: Wed, 10 Mar 2021 16:43:19 +0100 Subject: [PATCH] handle empty files more gracefully. --- neat.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/neat.js b/neat.js index 10c3104..aebffce 100644 --- a/neat.js +++ b/neat.js @@ -48,7 +48,15 @@ function loadFile(evt, onComplete) { function setupInterface(data, file, urls) { - if (data.data.length <= 0) return null; + if (data.data.length <= 0) { + let empty_html = ` + File is empty. + Load another one. + `; + + $('#tableregion').html(empty_html); + return null; + } // private variables of app