Commit 2e82691d authored by Black Hat's avatar Black Hat

Fix property null issue.

parent 06b0ce83
......@@ -25,7 +25,6 @@ Item {
text: "Please choose a room."
color: "#424242"
anchors.centerIn: parent
visible: listView.count === 0
}
}
......@@ -53,7 +52,7 @@ Item {
ImageStatus {
Layout.preferredWidth: parent.height
Layout.fillHeight: true
source: "image://mxc/" + currentRoom.myData.avatar
source: currentRoom == null || currentRoom.myData.avatar == null || currentRoom.myData.avatar == "" ? "qrc:/qml/asset/img/avatar.png" : "image://mxc/" + currentRoom.myData.avatar
}
ColumnLayout {
......@@ -62,7 +61,7 @@ Item {
Text {
Layout.fillWidth: true
text: currentRoom.myData.name
text: currentRoom != null ? currentRoom.myData.name : ""
font.pointSize: 18
color: "#424242"
elide: Text.ElideRight
......@@ -70,7 +69,7 @@ Item {
}
Text {
Layout.fillWidth: true
text: currentRoom.myData.topic
text: currentRoom != null ? currentRoom.myData.topic : ""
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment