From: Vincent van Ravesteijn Date: Sun, 31 Jan 2010 13:03:31 +0000 (+0000) Subject: Fix bug #6489: Assertion triggered when deleting contents of math ERT. (probably... X-Git-Tag: 2.0.0~4174 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=00bbabd00f9453f2d900e4d2e34eff5720a3fc08;p=lyx.git Fix bug #6489: Assertion triggered when deleting contents of math ERT. (probably a stdlib assertion). Do not access name_[0] if name_ has size 0. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33290 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index 03602106c0..b364563d3f 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -398,7 +398,8 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc) // go over the array and look for macros for (size_t i = 0; i < size(); ++i) { MathMacro * macroInset = operator[](i).nucleus()->asMacro(); - if (!macroInset || macroInset->name_[0] == '^' + if (!macroInset || macroInset->name_.size() == 0 + || macroInset->name_[0] == '^' || macroInset->name_[0] == '_' || macroInset->name() == edited_name) continue;