summaryrefslogtreecommitdiff
path: root/app-office/ktimetracker/files/ktimetracker-5.0.1-fix-edit-history-dialog-crash.patch
blob: a27b7b6ae4d771ec5712be101eb3f0d6774914f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From 065d7c154641f83c46e490cbb5d15b6cff92121b Mon Sep 17 00:00:00 2001
From: Marc Orcau <budalokko@gmail.com>
Date: Tue, 27 Apr 2021 17:17:18 +0200
Subject: [PATCH] Fix edit history dialog crash when event has non existent
 related entity

Replaced qFatal() by qCWarning(). Faulty event does not appear on the list then.

BUG: 424993
---
 src/dialogs/historydialog.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/dialogs/historydialog.cpp b/src/dialogs/historydialog.cpp
index ca2f10a..458c147 100644
--- a/src/dialogs/historydialog.cpp
+++ b/src/dialogs/historydialog.cpp
@@ -131,7 +131,9 @@ QString HistoryDialog::listAllEvents()
 
         const Task *parent = dynamic_cast<Task*>(m_projectModel->tasksModel()->taskByUID(event->relatedTo()));
         if (!parent) {
-            qFatal("orphan event");
+            qCWarning(KTT_LOG) << "Unable to load 'relatedTo' entry for " << event->summary();
+            err = "NoRelatedToForEvent";
+            continue;
         }
 
         auto *item = new QTableWidgetItem(parent->name());
-- 
GitLab