From 78bffdea4d792cee421f5382129b192df654c0f3 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 6 Aug 2023 13:52:33 +0200 Subject: Add note on empty pdf --- html/whiteboard.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/html/whiteboard.js b/html/whiteboard.js index 50b0058..07e3804 100644 --- a/html/whiteboard.js +++ b/html/whiteboard.js @@ -96,10 +96,14 @@ function on_version(version) function on_pdf(pdf) { - var a = document.getElementById("download-a"); - a.href = "data:application/pdf;base64," + pdf; - a.download = get_id() + ".pdf" - a.click(); + if (pdf == "") { + alert("Note: Empty PDF, not saving."); + } else { + var a = document.getElementById("download-a"); + a.href = "data:application/pdf;base64," + pdf; + a.download = get_id() + ".pdf" + a.click(); + } } function on_modify_ack(rev) -- cgit v1.2.3