diff --git a/src/kernel/environment.cpp b/src/kernel/environment.cpp index f8be8950f..c2c336189 100644 --- a/src/kernel/environment.cpp +++ b/src/kernel/environment.cpp @@ -153,7 +153,7 @@ unsigned environment::register_extension(std::shared_ptr= get_extension_manager().has_ext(id)) throw_invalid_extension(*this); - if (id < m_extensions->size() || !(*m_extensions)[id]) + if (id >= m_extensions->size() || !(*m_extensions)[id]) return get_extension_manager().get_initial(id); return *((*m_extensions)[id].get()); }