From f0ea697e9ebed567cebdf09ff6ae55a21d1106c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADnez=20Ruiz?= Date: Fri, 6 Aug 2021 10:43:16 +0200 Subject: [PATCH] Throw an exception if the filter is not found --- src/filters.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters.cpp b/src/filters.cpp index 3bb1d79e..8556339b 100644 --- a/src/filters.cpp +++ b/src/filters.cpp @@ -1061,7 +1061,7 @@ InternalValue UserDefinedFilter::Filter(const InternalValue& baseVal, RenderCont bool filterFound = false; auto filterValPtr = context.FindValue(m_filterName, filterFound); if (!filterFound) - return InternalValue(); + throw std::runtime_error("Can't find filter '" + m_filterName + "'"); const Callable* callable = GetIf(&filterValPtr->second); if (callable == nullptr || callable->GetKind() != Callable::UserCallable)