diff --git a/src/plugins/vcsbase/submiteditorwidget.cpp b/src/plugins/vcsbase/submiteditorwidget.cpp index 714dbe59d3f..14792da7d0d 100644 --- a/src/plugins/vcsbase/submiteditorwidget.cpp +++ b/src/plugins/vcsbase/submiteditorwidget.cpp @@ -519,8 +519,10 @@ void SubmitEditorWidget::verifyDescription() int secondLineLength = 0; if (subjectLength >= 0) { const int secondLineStart = subjectLength + 1; - secondLineLength = d->m_description.indexOf(newLine, secondLineStart) - - secondLineStart; + int secondLineEnd = d->m_description.indexOf(newLine, secondLineStart); + if (secondLineEnd == -1) + secondLineEnd = descriptionLength; + secondLineLength = secondLineEnd - secondLineStart; } else { subjectLength = descriptionLength; }