From ecf0553567839333ac325b92b237e10bf8aa23fc Mon Sep 17 00:00:00 2001 From: Kai Labusch Date: Thu, 1 Jun 2023 10:57:17 +0200 Subject: [PATCH] deal more robustly with missing coordinates --- neat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neat.js b/neat.js index 2ffa255..69ccf30 100644 --- a/neat.js +++ b/neat.js @@ -143,13 +143,16 @@ function setupInterface(data, file, urls) { let img_url = urls[data.data[nRow]['url_id']]; if (img_url == "http://empty") - return + return; let raw_left = parseInt(data.data[nRow]['left']); let raw_right = parseInt(data.data[nRow]['right']); let raw_top = parseInt(data.data[nRow]['top']); let raw_bottom = parseInt(data.data[nRow]['bottom']); + if (isNaN(raw_left) || isNaN(raw_right) || isNaN(raw_top) || isNaN(raw_bottom)) + return; + let left = raw_left; let right = raw_right; let top = raw_top;