diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 1b86dc316c..b4fef42542 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3197,7 +3197,8 @@ void InsetTabular::updateLabels(Buffer const & buf, ParIterator const & it) ParIterator it2 = it; it2.forwardPos(); - for ( ; it2.idx() <= it2.lastidx() ; it2.forwardIdx()) + size_t const end = it2.nargs(); + for ( ; it2.idx() < end; it2.forwardIdx()) lyx::updateLabels(buf, it2); //reset afterwards