diff --git a/src/kernel/declaration.cpp b/src/kernel/declaration.cpp index 30ab58a3c7..6791e88d3a 100644 --- a/src/kernel/declaration.cpp +++ b/src/kernel/declaration.cpp @@ -107,10 +107,11 @@ static bool use_untrusted(environment const & env, expr const & e) { for_each(e, [&](expr const & e, unsigned) { if (found) return false; if (is_constant(e)) { - declaration const & d = env.get(const_name(e)); - if (!d.is_trusted()) { - found = true; - return false; + if (auto d = env.find(const_name(e))) { + if (!d->is_trusted()) { + found = true; + return false; + } } } return true;