mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Avoid unnecessary JSON exceptions
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ec8838198f
commit
4762a95216
@@ -92,6 +92,7 @@ namespace BlackGui
|
||||
|
||||
void CAircraftIcaoForm::jsonPasted(const QString &json)
|
||||
{
|
||||
if (json.isEmpty()) { return; } // avoid unnecessary conversions
|
||||
try
|
||||
{
|
||||
CVariant jsonVariant;
|
||||
|
||||
@@ -157,6 +157,7 @@ namespace BlackGui
|
||||
|
||||
void CAirlineIcaoForm::jsonPasted(const QString &json)
|
||||
{
|
||||
if (json.isEmpty()) { return; } // avoid unnecessary conversions
|
||||
try
|
||||
{
|
||||
CVariant jsonVariant;
|
||||
@@ -183,7 +184,7 @@ namespace BlackGui
|
||||
}
|
||||
else if (variantDropped.canConvert<CAirlineIcaoCodeList>())
|
||||
{
|
||||
CAirlineIcaoCodeList icaoList(variantDropped.value<CAirlineIcaoCodeList>());
|
||||
const CAirlineIcaoCodeList icaoList(variantDropped.value<CAirlineIcaoCodeList>());
|
||||
if (icaoList.isEmpty()) { return; }
|
||||
icao = icaoList.front();
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ namespace BlackGui
|
||||
|
||||
void CLiveryForm::jsonPasted(const QString &json)
|
||||
{
|
||||
if (json.isEmpty()) { return; } // avoid unnecessary conversions
|
||||
try
|
||||
{
|
||||
CVariant jsonVariant;
|
||||
|
||||
Reference in New Issue
Block a user