diff --git a/passphrase_cache.cc b/passphrase_cache.cc index 6c71c61..210a94e 100644 --- a/passphrase_cache.cc +++ b/passphrase_cache.cc @@ -49,8 +49,10 @@ namespace pEp { { std::lock_guard lock(_mtx); - if (_cache.empty()) + if (_cache.empty()) { + _which = _cache.end(); throw std::underflow_error("empty passphrase cache"); + } if (_which == _cache.begin()) { _which = _cache.end();