1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 03:27:40 +01:00

Test for string length

This commit is contained in:
Andrew Udvare 2014-01-11 03:45:45 -08:00
parent 509a6af788
commit d46e0bacc6

View File

@ -151,7 +151,9 @@ void LineEdit::set_text(const QString& text) {
// For some reason Qt will detect any text with LTR at the end as LTR, so instead
// compare only the first character
set_rtl(QString(1, text.at(0)).isRightToLeft());
if (text.length()) {
set_rtl(QString(text.at(0)).isRightToLeft());
}
}
void LineEdit::paintEvent(QPaintEvent* e) {