From ee5c4952003efea903affb6b9a4cf4ce68dc3cb2 Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Fri, 11 Aug 2023 14:08:22 +0800 Subject: [PATCH] nixd/AST: handle exceptions for `getValueEval` --- nixd/lib/AST/EvalAST.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixd/lib/AST/EvalAST.cpp b/nixd/lib/AST/EvalAST.cpp index 3e94dd7fd..a0a40098f 100644 --- a/nixd/lib/AST/EvalAST.cpp +++ b/nixd/lib/AST/EvalAST.cpp @@ -78,7 +78,11 @@ EvalAST::getValueEval(const nix::Expr *Expr, if (!OpVAncestor) return std::nullopt; - forceValueDepth(State, *OpVAncestor, 2); + // TODO: add tests + try { + forceValueDepth(State, *OpVAncestor, 2); + } catch (...) { + } return getValue(Expr); }