Commit 3aed7ac4 authored by Milian Wolff's avatar Milian Wolff

Don't crash when project is closed before it was fully opened

When we start loading a project and then directly remove its
root folder, we would never get a projectOpened signal since
we never fully populated the project. But we will see a projectClosing
signal coming in, which would lead to a crash in the
ProjectChangesModel, as we would not have created an item for that
project yet. Prevent this crash by handling the scenario gracefully.
parent 131ea36f
......@@ -98,7 +98,11 @@ void ProjectChangesModel::addProject(IProject* p)
void ProjectChangesModel::removeProject(IProject* p)
QStandardItem* it=projectItem(p);
if (!it) {
// when the project is closed before it was fully populated, we won't ever see a
// projectOpened signal - handle this gracefully by just ignoring the remove request
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment