mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:40:05 +00:00
Don't attempt to load an object that hasn't been listed yet by the provider
- Fixes issue when switching to a new product, product does not display the first time
This commit is contained in:
parent
7d74a0e312
commit
ea1569cb76
2 changed files with 18 additions and 9 deletions
|
|
@ -792,7 +792,16 @@ void RadarProductManagerImpl::LoadProviderData(
|
|||
if (existingRecord == nullptr)
|
||||
{
|
||||
std::string key = providerManager->provider_->FindKey(time);
|
||||
nexradFile = providerManager->provider_->LoadObjectByKey(key);
|
||||
|
||||
if (!key.empty())
|
||||
{
|
||||
nexradFile = providerManager->provider_->LoadObjectByKey(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger_->warn("Attempting to load object without key: {}",
|
||||
scwx::util::TimeString(time));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1042,7 +1051,7 @@ RadarProductManagerImpl::GetLevel2ProductRecord(
|
|||
record = recordPtr->second.lock();
|
||||
}
|
||||
|
||||
if (record == nullptr &&
|
||||
if (recordPtr != nullptr && record == nullptr &&
|
||||
recordTime != std::chrono::system_clock::time_point {})
|
||||
{
|
||||
// Product is expired, reload it
|
||||
|
|
@ -1107,7 +1116,7 @@ RadarProductManagerImpl::GetLevel3ProductRecord(
|
|||
}
|
||||
}
|
||||
|
||||
if (record == nullptr &&
|
||||
if (recordPtr != nullptr && record == nullptr &&
|
||||
recordTime != std::chrono::system_clock::time_point {})
|
||||
{
|
||||
// Product is expired, reload it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue