diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index ca123afad5..bc01712343 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -753,13 +753,23 @@ void MathMacro::maple(MapleStream & os) const void MathMacro::mathmlize(MathStream & os) const { - os << expanded_.cell(0); + MathData const & data = expanded_.cell(0); + if (data.empty()) { + // this means that we do not recognize the macro + throw MathExportException(); + } + os << data; } void MathMacro::htmlize(HtmlStream & os) const { - os << expanded_.cell(0); + MathData const & data = expanded_.cell(0); + if (data.empty()) { + // this means that we do not recognize the macro + throw MathExportException(); + } + os << data; }