From 82d8d97a3665d4e43f98c46c6da8382e82162df7 Mon Sep 17 00:00:00 2001 From: David Ryskalczyk Date: Sun, 26 May 2019 14:24:06 -0400 Subject: [PATCH] Skip attachments with missing thumbnails --- chattr.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/chattr.html b/chattr.html index a0d59c6..2ca63d3 100644 --- a/chattr.html +++ b/chattr.html @@ -900,13 +900,14 @@

Contact List

var attachmentRoot = "attachments.noindex/"; if (media) { var thumb = media["thumbnail"]; - var thumbPath = attachmentRoot + thumb["path"]; - var thumbWidth = thumb["width"] + "px"; - var thumbHeight = thumb["height"] + "px"; - + if(thumb) { + var thumbPath = attachmentRoot + thumb["path"]; + var thumbWidth = thumb["width"] + "px"; + var thumbHeight = thumb["height"] + "px"; + } /* If attachments are used as the root message of a quote, it won't * have a base path itself, only a thumbnail. */ - if (media["path"]) { + if (thumb && media["path"]) { var mediaId = media["path"].split("/")[1]; var mediaPath = attachmentRoot + media["path"]; var mediaWidth = media["width"]; @@ -928,7 +929,7 @@

Contact List

content += ""; - } else { + } else if(thumb) { content = "";