From 0a9c29f0b9c266d08ae218318194cedc53815f42 Mon Sep 17 00:00:00 2001 From: Angela Mazzurco Date: Tue, 13 Jun 2017 14:40:05 +0200 Subject: [PATCH] Solve bug with undefined props in lastMessage object --- retroshare-qml-app/src/GxsIdentityDelegate.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-qml-app/src/GxsIdentityDelegate.qml b/retroshare-qml-app/src/GxsIdentityDelegate.qml index 42bb656f6..bd53a029e 100644 --- a/retroshare-qml-app/src/GxsIdentityDelegate.qml +++ b/retroshare-qml-app/src/GxsIdentityDelegate.qml @@ -137,7 +137,7 @@ Item id: lastMessageSender font.italic: true color: "royalblue" - text: (!lastMessageData.incoming && lastMessageData.msg)? "You: " : "" + text: ((lastMessageData && lastMessageData.incoming !== undefined) && !lastMessageData.incoming)? "You: " : "" height: parent.height } @@ -145,7 +145,7 @@ Item { id: lastMessageMsg anchors.left: lastMessageSender.right - text: (lastMessageData.msg) ? lastMessageData.msg : "" + text: (lastMessageData && lastMessageData.msg !== undefined)? lastMessageData.msg : "" rightPadding: 5 elide: Text.ElideRight color: "darkslategrey" @@ -210,7 +210,7 @@ Item } if (chatId) { var last = getChatLastMessage(chatId) - if (last) lastMessageData = getChatLastMessage(chatId) + if (last) lastMessageData = last } } @@ -237,7 +237,7 @@ Item return ChatCache.lastMessageCache.getChatIdFromGxs(model.gxs_id) } function setTime(){ - if (!lastMessageData.recv_time){ + if (!lastMessageData || lastMessageData.recv_time === undefined){ return "" } var timeFormat = "dd.MM.yyyy";