Skip to content

Commit 493d43a

Browse files
committed
ProjectManagerPlugin: prevent crash when file is deleted (#42)
This slightly overcomes #42. I need to re-test this issue under several situations to understand if this is all thats neede. refs #42
1 parent 5e1fc21 commit 493d43a

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/plugins/ProjectManager/ProjectManagerPlg.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,11 +1041,15 @@ void ProjectManagerPlugin::clearProject_clicked() {
10411041
void ProjectManagerPlugin::projectFile_modified(const QString &path) {
10421042
auto onDiskConfig = ProjectBuildConfig::buildFromFile(path);
10431043
auto inMemoryConfig = projectModel->findConfigFile(path);
1044-
if (*onDiskConfig == *inMemoryConfig) {
1045-
qDebug("Config file modified, content similar ignoring - %s", path.toStdString().data());
1046-
return;
1044+
1045+
if (onDiskConfig) {
1046+
if (*onDiskConfig == *inMemoryConfig) {
1047+
qDebug("Config file modified, content similar ignoring - %s",
1048+
path.toStdString().data());
1049+
return;
1050+
}
1051+
*inMemoryConfig = *onDiskConfig;
10471052
}
1048-
*inMemoryConfig = *onDiskConfig;
10491053
newProjectSelected(gui->projectComboBox->currentIndex());
10501054

10511055
// TODO - new file created is not working yet.

0 commit comments

Comments
 (0)