From 7c08d889906af610337a58a1166661f07e21b566 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Tue, 21 Feb 2023 14:32:35 +0100 Subject: print errors on failed dialog creation Signed-off-by: Marcus Hoffmann --- resources/qml/TimelineView.qml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'resources/qml/TimelineView.qml') 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() -- cgit 1.5.1