summary refs log tree commit diff
path: root/resources/qml/TimelineView.qml
diff options
context:
space:
mode:
authorMarcus Hoffmann <bubu@bubu1.eu>2023-02-21 14:32:35 +0100
committerMarcus Hoffmann <bubu@bubu1.eu>2023-02-22 13:14:16 +0100
commit7c08d889906af610337a58a1166661f07e21b566 (patch)
treebcc4004b361969f377a6b5dc0ab0dfe05aeca050 /resources/qml/TimelineView.qml
parentTranslated using Weblate (Esperanto) (diff)
downloadnheko-7c08d889906af610337a58a1166661f07e21b566.tar.xz
print errors on failed dialog creation
Signed-off-by: Marcus Hoffmann <bubu@bubu1.eu>
Diffstat (limited to '')
-rw-r--r--resources/qml/TimelineView.qml15
1 files changed, 10 insertions, 5 deletions
diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 5accbcd6..aa39560a 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -423,11 +423,16 @@ Item {
         }
 
         function onShowRawMessageDialog(rawMessage) {
-            var dialog = Qt.createComponent("qrc:/qml/dialogs/RawMessageDialog.qml").createObject(timelineRoot, {
-                "rawMessage": rawMessage
-            });
-            dialog.show();
-            timelineRoot.destroyOnClose(dialog);
+            var component = Qt.createComponent("qrc:/qml/dialogs/RawMessageDialog.qml")
+            if (component.status == Component.Ready) {
+                var dialog = component.createObject(timelineRoot, {
+                    "rawMessage": rawMessage
+                });
+                dialog.show();
+                timelineRoot.destroyOnClose(dialog);
+            } else {
+                console.error("Failed to create component: " + component.errorString());
+            }
         }
 
         function onConfetti()