Browse Source

adding error message

gcmalloc 7 years ago
parent
commit
7b066862fd
1 changed files with 3 additions and 0 deletions
  1. 3 0
      main.js

+ 3 - 0
main.js

@@ -34,6 +34,9 @@ function checkHours(hoursForm) {
         openButton = formParent.openbutton;
     hoursOpen = Math.floor(hoursOpen);
     //TODO throw error if parentElement is null
+    if (openButton == null) {
+        alert("The page was malformed, you should reload it now.")
+    }
     if (isNaN(hoursOpen) || hoursOpen < 1) {
         openButton.disabled = true;
     } else {