diff --git a/src/kernel/environment.cpp b/src/kernel/environment.cpp index f2f3b8be5..ea3952b10 100644 --- a/src/kernel/environment.cpp +++ b/src/kernel/environment.cpp @@ -160,7 +160,7 @@ unsigned environment::register_extension(std::shared_ptr= get_extension_manager().has_ext(id)) + if (!get_extension_manager().has_ext(id)) throw_invalid_extension(*this); if (id >= m_extensions->size() || !(*m_extensions)[id]) return get_extension_manager().get_initial(id); @@ -168,7 +168,7 @@ environment_extension const & environment::get_extension(unsigned id) const { } environment environment::update(unsigned id, std::shared_ptr const & ext) const { - if (id >= get_extension_manager().has_ext(id)) + if (!get_extension_manager().has_ext(id)) throw_invalid_extension(*this); auto new_exts = std::make_shared(*m_extensions); if (id >= new_exts->size())