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);