From 2f843936ed0629eaf122a41e811fb84ee5d63dd4 Mon Sep 17 00:00:00 2001
From: psy <psy@darmstadt.ccc.de>
Date: Wed, 27 Jan 2021 13:59:13 +0100
Subject: [PATCH] dont mail pad if owner is not set

---
 files/hedgedoc-util.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/files/hedgedoc-util.py b/files/hedgedoc-util.py
index 3ce2712..f1916cf 100755
--- a/files/hedgedoc-util.py
+++ b/files/hedgedoc-util.py
@@ -117,6 +117,9 @@ def pad_mail(db, id, template, formats):
 	with db.cursor() as cursor:
 		pad = pad_get(db, id)
 
+		if not pad['ownerId']:
+			return
+
 		converted_formats = {}
 		if 'dokuwiki' in formats:
 			converter = Popen(["pandoc", "-o", "/dev/stdout", "-s", "-f", "markdown", "-t", "dokuwiki", "-i", "/dev/stdin"], stdin=PIPE, stdout=PIPE)
-- 
GitLab