Fix possible null-dereference (thanks Coverity)
authorColin Leroy <colin@colino.net>
Fri, 28 Sep 2018 08:29:27 +0000 (10:29 +0200)
committerColin Leroy <colin@colino.net>
Fri, 28 Sep 2018 08:29:27 +0000 (10:29 +0200)
src/messageview.c

index a87c2c2..6a73c63 100644 (file)
@@ -1269,8 +1269,8 @@ static gboolean messageview_try_select_mimeinfo(MessageView *messageview, MsgInf
                        return TRUE;
                } else if (!strcasecmp(mimeinfo->subtype, "html")
                                && mimeinfo->disposition != DISPOSITIONTYPE_ATTACHMENT
-                               && (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS
-                                       || (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT
+                               && ((msginfo->folder && msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS)
+                                       || ((msginfo->folder && msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT)
                                                && prefs_common.promote_html_part))) {
                        mimeview_select_mimepart_icon(messageview->mimeview, mimeinfo);
                        return TRUE;