mdbx: minor fix assertion in the prev commit.

One more for https://github.com/erthink/libmdbx/issues/171.

Change-Id: I49be3df948f3dbcc838f3dc307155ac404cfb331
This commit is contained in:
Leonid Yuriev 2021-03-13 19:40:00 +03:00
parent f7cd08ea48
commit 439cccf65f

View File

@ -6565,9 +6565,10 @@ static __inline int check_env(const MDBX_env *env, const bool wanna_active) {
if (unlikely(env->me_flags & MDBX_FATAL_ERROR))
return MDBX_PANIC;
if (wanna_active && unlikely((env->me_flags & MDBX_ENV_ACTIVE) == 0)) {
if (wanna_active) {
if (unlikely((env->me_flags & MDBX_ENV_ACTIVE) == 0))
return MDBX_EPERM;
mdbx_assert(env, env->me_map != nullptr);
return MDBX_EPERM;
}
return MDBX_SUCCESS;