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

Fix property null issue.

parent 06b0ce83
...@@ -25,7 +25,6 @@ Item { ...@@ -25,7 +25,6 @@ Item {
text: "Please choose a room." text: "Please choose a room."
color: "#424242" color: "#424242"
anchors.centerIn: parent anchors.centerIn: parent
visible: listView.count === 0
} }
} }
...@@ -53,7 +52,7 @@ Item { ...@@ -53,7 +52,7 @@ Item {
ImageStatus { ImageStatus {
Layout.preferredWidth: parent.height Layout.preferredWidth: parent.height
Layout.fillHeight: true 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 { ColumnLayout {
...@@ -62,7 +61,7 @@ Item { ...@@ -62,7 +61,7 @@ Item {
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
text: currentRoom.myData.name text: currentRoom != null ? currentRoom.myData.name : ""
font.pointSize: 18 font.pointSize: 18
color: "#424242" color: "#424242"
elide: Text.ElideRight elide: Text.ElideRight
...@@ -70,7 +69,7 @@ Item { ...@@ -70,7 +69,7 @@ Item {
} }
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
text: currentRoom.myData.topic text: currentRoom != null ? currentRoom.myData.topic : ""
color: "#424242" color: "#424242"
elide: Text.ElideRight elide: Text.ElideRight
wrapMode: Text.NoWrap 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