diff options
-rw-r--r-- | src/gui/text/qtextformat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index e7dcd3cb9c1..509b2eb7ccb 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -3993,7 +3993,7 @@ bool QTextFormatCollection::hasFormatCached(const QTextFormat &format) const int QTextFormatCollection::objectFormatIndex(int objectIndex) const { - if (objectIndex == -1) + if (objectIndex == -1 || objectIndex >= objFormats.size()) return -1; return objFormats.at(objectIndex); } |