From 446e86d4ad798655aa1a83aebc86f9f2431484df Mon Sep 17 00:00:00 2001 From: fiaxh Date: Sat, 29 Dec 2018 19:15:25 +0100 Subject: Check FileTransfer's mime_type for null (unknown) when handeling it fixes #479 --- main/src/ui/conversation_selector/conversation_row.vala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main/src/ui/conversation_selector') diff --git a/main/src/ui/conversation_selector/conversation_row.vala b/main/src/ui/conversation_selector/conversation_row.vala index 88234006..2d41d044 100644 --- a/main/src/ui/conversation_selector/conversation_row.vala +++ b/main/src/ui/conversation_selector/conversation_row.vala @@ -150,10 +150,11 @@ public class ConversationRow : ListBoxRow { nick_label.label = transfer.direction == Message.DIRECTION_SENT ? _("Me") + ": " : ""; } + bool file_is_image = transfer.mime_type != null && transfer.mime_type.has_prefix("image"); if (transfer.direction == Message.DIRECTION_SENT) { - message_label.label = "" + (transfer.mime_type.has_prefix("image") ? _("Image sent") : _("File sent") ) + ""; + message_label.label = "" + (file_is_image ? _("Image sent") : _("File sent") ) + ""; } else { - message_label.label = "" +(transfer.mime_type.has_prefix("image") ? _("Image received") : _("File received") ) + ""; + message_label.label = "" + (file_is_image ? _("Image received") : _("File received") ) + ""; } break; } -- cgit v1.2.3-70-g09d2