diff --git a/slackviewer/templates/viewer.html b/slackviewer/templates/viewer.html
index 8e17c2f..714752f 100644
--- a/slackviewer/templates/viewer.html
+++ b/slackviewer/templates/viewer.html
@@ -62,7 +62,7 @@
Group Direct Messages
{% for message in messages %}
{% if message.msg or message.files %}
- {% if "Thread Reply:" in message.msg %}
+ {% if message.msg and "Thread Reply:" in message.msg %}
{{render_message(message, None, no_external_references, reply=True)}}
{% else %}
{{render_message(message, None, no_external_references, reply=False)}}