Browse Source

Session retrieval throws if the Session handling has not been initialized.

pull/15/head
heck 2 years ago
parent
commit
3428cd1177
  1. 8
      src/Adapter.cc

8
src/Adapter.cc

@ -109,9 +109,13 @@ namespace pEp {
// public // public
::PEP_SESSION Session::operator()() ::PEP_SESSION Session::operator()()
{ {
if (!_session.get()) { if(!_is_initialized) {
throw std::runtime_error( throw std::runtime_error(
"libpEpAdapter: No session! Before use, call session.initialize() for each thread"); "libpEpAdapter: No session! Before first use, call session::initialize()");
} else {
if (!_session.get()) {
_new();
}
} }
return _session.get(); return _session.get();
} }

Loading…
Cancel
Save