From 34cb5776f6a350155b0cbbbdbf35a5e7c1520b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Delhaie?= Date: Thu, 31 Oct 2024 16:16:15 +0100 Subject: [PATCH] Fix crash --- src/frames/mainwindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frames/mainwindow.cpp b/src/frames/mainwindow.cpp index bde5993..7890e29 100644 --- a/src/frames/mainwindow.cpp +++ b/src/frames/mainwindow.cpp @@ -702,6 +702,10 @@ void MainWindow::redrawTaskTree() { QTreeWidget *l = ui->taskList; uint16_t itemCount = l->topLevelItemCount(); + if (itemCount == 0) + { + return; + } for (int16_t i = itemCount; i >= 0; i--) { delete l->takeTopLevelItem(i);