diff --git a/files/hedgedoc-util.py b/files/hedgedoc-util.py
index 3ce27126ba2bf8ff8cbc6e40746023208eb81b68..f1916cf476a3b13a5b5d75d6ce274d704835afd2 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)