summary refs log tree commit diff
path: root/resources/qml/RoomList.qml
diff options
context:
space:
mode:
Diffstat (limited to 'resources/qml/RoomList.qml')
-rw-r--r--resources/qml/RoomList.qml24
1 files changed, 16 insertions, 8 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index 79be77e9..a56f817e 100644
--- a/resources/qml/RoomList.qml
+++ b/resources/qml/RoomList.qml
@@ -470,11 +470,14 @@ Page {
 
             function openUserProfile() {
                 Nheko.updateUserProfile();
-                var userProfile = Qt.createComponent("qrc:/qml/dialogs/UserProfile.qml").createObject(timelineRoot, {
-                    "profile": Nheko.currentUser
-                });
-                userProfile.show();
-                timelineRoot.destroyOnClose(userProfile);
+                var component = Qt.createComponent("qrc:/qml/dialogs/UserProfile.qml")
+                if (component.status == Component.Ready) {
+                    var userProfile = component.createObject(timelineRoot, {"profile": Nheko.currentUser});
+                    userProfile.show();
+                    timelineRoot.destroyOnClose(userProfile);
+                } else {
+                    console.error("Failed to create component: " + component.errorString());
+                }
             }
 
 
@@ -790,9 +793,14 @@ Page {
                     ToolTip.text: qsTr("Search rooms (Ctrl+K)")
                     Layout.margins: Nheko.paddingMedium
                     onClicked: {
-                        var quickSwitch = Qt.createComponent("qrc:/qml/QuickSwitcher.qml").createObject(timelineRoot);
-                        quickSwitch.open();
-                        destroyOnClosed(quickSwitch);
+                        var component = Qt.createComponent("qrc:/qml/QuickSwitcher.qml")
+                        if (component.status == Component.Ready) {
+                            var quickSwitch = component.createObject(timelineRoot);
+                            quickSwitch.open();
+                            destroyOnClosed(quickSwitch);
+                        } else {
+                            console.error("Failed to create component: " + component.errorString());
+                        }
                     }
                 }