diff --git a/apps/code/python_text_area.cpp b/apps/code/python_text_area.cpp index d3ab068ef..54e0fe390 100644 --- a/apps/code/python_text_area.cpp +++ b/apps/code/python_text_area.cpp @@ -164,8 +164,8 @@ void PythonTextArea::ContentView::drawLine(KDContext * ctx, int line, const char // Redraw the autocompleted word in the right color const char * autocompleteStart = m_cursorLocation; - assert(autocompleteStart != text); - if (m_autocomplete && autocompleteStart > text && autocompleteStart < text + byteLength) { + assert(!m_autocomplete || autocompleteStart != text); + if (m_autocomplete && autocompleteStart > text && autocompleteStart < text + byteLength) { const char * autocompleteEnd = UTF8Helper::EndOfWord(autocompleteStart); drawStringAt( ctx,