mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Extra validation to prevent asserts from invalid CSL files
This commit is contained in:
@@ -448,6 +448,11 @@ namespace BlackMisc
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (package.planes.isEmpty())
|
||||
{
|
||||
m_loadingMessages.push_back(CStatusMessage(this).error(u"%1/xsb_aircraft.txt Line %2 : invalid position for command.") << path << lineNum);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tokens[1] != "SOLID") { return true; }
|
||||
|
||||
@@ -487,6 +492,11 @@ namespace BlackMisc
|
||||
m_loadingMessages.push_back(m);
|
||||
return false;
|
||||
}
|
||||
if (package.planes.isEmpty())
|
||||
{
|
||||
m_loadingMessages.push_back(CStatusMessage(this).error(u"%1/xsb_aircraft.txt Line %2 : invalid position for command.") << path << lineNum);
|
||||
return false;
|
||||
}
|
||||
|
||||
QString icao = tokens[1];
|
||||
package.planes.back().icao = icao;
|
||||
@@ -502,6 +512,11 @@ namespace BlackMisc
|
||||
m_loadingMessages.push_back(m);
|
||||
return false;
|
||||
}
|
||||
if (package.planes.isEmpty())
|
||||
{
|
||||
m_loadingMessages.push_back(CStatusMessage(this).error(u"%1/xsb_aircraft.txt Line %2 : invalid position for command.") << path << lineNum);
|
||||
return false;
|
||||
}
|
||||
|
||||
QString icao = tokens[1];
|
||||
package.planes.back().icao = icao;
|
||||
@@ -519,6 +534,11 @@ namespace BlackMisc
|
||||
m_loadingMessages.push_back(m);
|
||||
return false;
|
||||
}
|
||||
if (package.planes.isEmpty())
|
||||
{
|
||||
m_loadingMessages.push_back(CStatusMessage(this).error(u"%1/xsb_aircraft.txt Line %2 : invalid position for command.") << path << lineNum);
|
||||
return false;
|
||||
}
|
||||
|
||||
QString icao = tokens[1];
|
||||
package.planes.back().icao = icao;
|
||||
|
||||
Reference in New Issue
Block a user