Skip to content

Commit

Permalink
Do not access the first character when the text is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed Sep 27, 2016
1 parent 42f8287 commit ea3364c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ QString InputConv::convertKey(const QString& text, int k, Qt::KeyboardModifiers
{
QChar c;
if (specialKeys.contains(k)) {
c = text.at(0);
c = text.isEmpty() ? QChar() : text.at(0);
if (text.isEmpty() || c.isSpace() || !c.isPrint()) {
return QString("<%1%2>").arg(modPrefix(mod)).arg(specialKeys.value(k));
} else {
Expand Down

0 comments on commit ea3364c

Please sign in to comment.