From 2f008730f984e0e29be67abd7bf45a90722113b8 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 1 Jun 2024 22:07:17 +0100 Subject: [PATCH] check if the paste contents is empty --- src/main/resources/templates/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index d9c67b3..41f0e2c 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -47,6 +47,10 @@ var pasteInput = document.getElementById('paste-input'); var paste = pasteInput.value; + if (!paste || paste.trim() === ''){ + return; + } + fetch('/api/upload', { method: 'POST', headers: {