diff --git a/src/frontends/qt4/GuiFontMetrics.C b/src/frontends/qt4/GuiFontMetrics.C index 0a1138bfb5..d1ed0ecea8 100644 --- a/src/frontends/qt4/GuiFontMetrics.C +++ b/src/frontends/qt4/GuiFontMetrics.C @@ -148,6 +148,9 @@ int GuiFontMetrics::width(QString const & ucs2) const int GuiFontMetrics::signedWidth(docstring const & s) const { + if (s.empty()) + return 0; + if (s[0] == '-') return -width(&(s[1]), s.length() - 1); else