mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Handled some potentially "dangerous" parsing issues for VATSIM file (no coordinate)
https://discordapp.com/channels/539048679160676382/539486489977946112/593081121512751116
This commit is contained in:
committed by
Mat Sutcliffe
parent
b2b85795e0
commit
4ecd8a78ad
@@ -251,9 +251,17 @@ namespace BlackMisc
|
||||
template <class MU, class PQ>
|
||||
PQ &CPhysicalQuantity<MU, PQ>::switchUnit(const MU &newUnit)
|
||||
{
|
||||
// NULL check: https://discordapp.com/channels/539048679160676382/539925070550794240/593151683698229258
|
||||
if (m_unit == newUnit || this->isNull()) { return *derived(); }
|
||||
m_value = newUnit.convertFrom(m_value, m_unit);
|
||||
m_unit = newUnit;
|
||||
if (newUnit.isNull())
|
||||
{
|
||||
this->setNull();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_value = newUnit.convertFrom(m_value, m_unit);
|
||||
m_unit = newUnit;
|
||||
}
|
||||
return *derived();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user