Commit 490a74e9 authored by Denis Steckelmacher's avatar Denis Steckelmacher

Don't crash when the code-completion is triggered with an empty text, while...

Don't crash when the code-completion is triggered with an empty text, while still displaying something
parent f03b177f
......@@ -59,11 +59,11 @@ QList<CompletionTreeItemPointer> CodeCompletionContext::completionItems(bool& ab
QList<CompletionTreeItemPointer> items;
if (abort || m_text.isEmpty()) {
if (abort) {
return items;
}
QChar lastChar = m_text.at(m_text.size() - 1);
QChar lastChar = m_text.size() > 0 ? m_text.at(m_text.size() - 1) : QLatin1Char('\0');
if (lastChar == QLatin1Char('.') || lastChar == QLatin1Char('[')) {
// Offer completions for object members and array subscripts
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment