From bf80b78247ea79d59779b4e4a8a89d5f45a69cfc Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 19 Mar 2022 19:06:05 +0000 Subject: [PATCH] [DOM XSLT] Add fallback value conversions if not converted beforehand. --- dom/xslt/xslt/txMozillaXSLTProcessor.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp index 59cd09bd6a..0df80716c1 100644 --- a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp +++ b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp @@ -250,7 +250,13 @@ public: } nsresult getValue(txAExprResult** aValue) { - NS_ASSERTION(mTxValue, "variablevalue is null"); + if (!mTxValue) { + // XXX: This should not happen as we normally convert values before + // we call this function. For corner cases where this isn't true, we + // perform the conversion here. + nsresult rv = Convert(mValue, getter_AddRefs(mTxValue)); + NS_ENSURE_SUCCESS(rv, rv); + } *aValue = mTxValue; NS_ADDREF(*aValue);