mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Ref T786, weather checks
* avoid NULL distances * avoid incomplete requests
This commit is contained in:
committed by
Mat Sutcliffe
parent
5ef25d4a41
commit
4af35e92c1
@@ -71,6 +71,17 @@ namespace BlackCore
|
||||
|
||||
void CWeatherManager::requestWeatherGrid(const CWeatherGrid &initialWeatherGrid, const CIdentifier &identifier)
|
||||
{
|
||||
if (identifier.isNull() || initialWeatherGrid.isEmpty() || initialWeatherGrid.frontOrDefault().getPosition().isNull())
|
||||
{
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
BLACK_VERIFY_X(!identifier.isNull(), Q_FUNC_INFO, "Missing callback");
|
||||
BLACK_VERIFY_X(!initialWeatherGrid.isEmpty(), Q_FUNC_INFO, "Empty grid, need position");
|
||||
BLACK_VERIFY_X(!initialWeatherGrid.frontOrDefault().getPosition().isNull(), Q_FUNC_INFO, "NULL position");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const WeatherRequest weatherRequest { {}, identifier, initialWeatherGrid, {} };
|
||||
this->appendRequest(weatherRequest);
|
||||
|
||||
@@ -81,8 +92,16 @@ namespace BlackCore
|
||||
void CWeatherManager::requestWeatherGrid(const CWeatherGrid &initialWeatherGrid,
|
||||
const CSlot<void(const CWeatherGrid &)> &callback)
|
||||
{
|
||||
BLACK_VERIFY_X(callback, Q_FUNC_INFO, "Missing callback");
|
||||
if (!callback) { return; }
|
||||
if (!callback || initialWeatherGrid.isEmpty() || initialWeatherGrid.frontOrDefault().getPosition().isNull())
|
||||
{
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild())
|
||||
{
|
||||
BLACK_VERIFY_X(callback, Q_FUNC_INFO, "Missing callback");
|
||||
BLACK_VERIFY_X(!initialWeatherGrid.isEmpty(), Q_FUNC_INFO, "Empty grid, need position");
|
||||
BLACK_VERIFY_X(!initialWeatherGrid.frontOrDefault().getPosition().isNull(), Q_FUNC_INFO, "NULL position");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_isWeatherClear)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user