Check that X-Plane OBJ8 file exists

This commit is contained in:
Roland Rossgotterer
2019-09-04 14:47:55 +02:00
committed by Mat Sutcliffe
parent 108f773e8a
commit e8b14c435f

View File

@@ -548,6 +548,12 @@ namespace BlackMisc
dirNames.removeLast(); dirNames.removeLast();
QFileInfo fileInfo(fullPath); QFileInfo fileInfo(fullPath);
if (! fileInfo.exists())
{
const CStatusMessage m = CStatusMessage(this).error(u"XPlane object '%1' does not exist.") << fullPath;
m_loadingMessages.push_back(m);
return false;
}
package.planes.back().dirNames = dirNames; package.planes.back().dirNames = dirNames;
package.planes.back().objectName = fileInfo.completeBaseName(); package.planes.back().objectName = fileInfo.completeBaseName();
package.planes.back().filePath = fullPath; package.planes.back().filePath = fullPath;