summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextlayout.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index ee658d9e41..16f7150270 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2508,6 +2508,10 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
int pos = *cursorPos;
int itm;
const HB_CharAttributes *attributes = eng->attributes();
+ if (!attributes) {
+ *cursorPos = 0;
+ return x.toReal();
+ }
while (pos < line.from + line.length && !attributes[pos].charStop)
pos++;
if (pos == line.from + (int)line.length) {