Fixed CID 1378777, uncaught exception

This commit is contained in:
Daniel Marjamäki 2017-09-02 11:11:35 +02:00
parent 9eed9adf3c
commit 33664a88d1
1 changed files with 11 additions and 1 deletions

View File

@ -1448,7 +1448,17 @@ void MainWindow::analyzeProject(const ProjectFile *projectFile)
if (!projectFile->getImportProject().isEmpty()) { if (!projectFile->getImportProject().isEmpty()) {
ImportProject p; ImportProject p;
QString prjfile = inf.canonicalPath() + '/' + projectFile->getImportProject(); QString prjfile = inf.canonicalPath() + '/' + projectFile->getImportProject();
p.import(prjfile.toStdString()); try {
p.import(prjfile.toStdString());
} catch (InternalError &e) {
QMessageBox msg(QMessageBox::Critical,
tr("Cppcheck"),
tr("Failed to import '%1', analysis is stopped").arg(prjfile),
QMessageBox::Ok,
this);
msg.exec();
return;
}
doAnalyzeProject(p); doAnalyzeProject(p);
return; return;
} }