From 46695b8236f36340ef01cde40d1581ea9223cf83 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Thu, 27 Jun 2019 13:21:47 +0200 Subject: [PATCH] error on invalid hours argument --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 37954d9..d4ce46d 100644 --- a/index.js +++ b/index.js @@ -206,6 +206,9 @@ class App { async update(sheetname, startDate, endDate, hours) { // set values in sheet console.log("Setting data in", sheetname) hours = +hours + if (isNaN(hours)) { + throw "hours argument not a float or int" + } const values = { regular: Math.min(hours, 80), overwork: Math.max(0, hours-80),