fix: CacheLoader causes crash when no cache is used (#1853)

If cache is disabled or Clio starts with and empty DB, `loader_` inside
cache is not created. So calling `CacheLoader::stop()` or
`CacheLoader::wait()` was causing crash.
This commit is contained in:
Sergey Kuznetsov
2025-01-28 18:10:19 +00:00
committed by GitHub
parent 540e938223
commit 75354fbecd
2 changed files with 19 additions and 2 deletions

View File

@@ -130,7 +130,8 @@ public:
void
stop() noexcept
{
loader_->stop();
if (loader_ != nullptr)
loader_->stop();
}
/**
@@ -139,7 +140,8 @@ public:
void
wait() noexcept
{
loader_->wait();
if (loader_ != nullptr)
loader_->wait();
}
};