size_t const n = slices_.size();
slices_.resize(0);
for (size_t i = 0 ; i < n; ++i) {
- if (dit[i].empty() && prevMath().lyxCode() == MATH_SCRIPT_CODE)
+ if (dit[i].empty() && pos() > 0 && prevMath().lyxCode() == MATH_SCRIPT_CODE)
// Workaround: With empty optional argument and a trailing script,
// we have empty slices in math macro args (#11676)
// FIXME: Find real cause!