aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/conversation_selector
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2018-12-29 19:15:25 +0100
committerfiaxh <git@lightrise.org>2018-12-31 16:49:22 +0100
commit446e86d4ad798655aa1a83aebc86f9f2431484df (patch)
tree85948047dcc223ad1ccf130f087fb8a2c2382a11 /main/src/ui/conversation_selector
parent420942873a595415d09c9a48b9950c214e77008b (diff)
downloaddino-446e86d4ad798655aa1a83aebc86f9f2431484df.tar.gz
dino-446e86d4ad798655aa1a83aebc86f9f2431484df.zip
Check FileTransfer's mime_type for null (unknown) when handeling it
fixes #479
Diffstat (limited to 'main/src/ui/conversation_selector')
-rw-r--r--main/src/ui/conversation_selector/conversation_row.vala5
1 files changed, 3 insertions, 2 deletions
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 = "<i>" + (transfer.mime_type.has_prefix("image") ? _("Image sent") : _("File sent") ) + "</i>";
+ message_label.label = "<i>" + (file_is_image ? _("Image sent") : _("File sent") ) + "</i>";
} else {
- message_label.label = "<i>" +(transfer.mime_type.has_prefix("image") ? _("Image received") : _("File received") ) + "</i>";
+ message_label.label = "<i>" + (file_is_image ? _("Image received") : _("File received") ) + "</i>";
}
break;
}