FakeVim: Avoid possible nullptr access

Amends 9f0919c4a3.

Fixes: QTCREATORBUG-30730
Change-Id: I389412a0b069fd34a625075d97c89f106c5b5f74
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2024-06-13 08:55:47 +02:00
parent c5564559cc
commit 20dda9d5fd

View File

@@ -1502,7 +1502,7 @@ void FakeVimPlugin::editorOpened(IEditor *editor)
handler->modeChanged.set([tew, this, editor](bool insertMode) {
HandlerAndData &handlerAndData = m_editorToHandler[editor];
if (!handlerAndData.handler->inFakeVimMode())
if (!handlerAndData.handler || !handlerAndData.handler->inFakeVimMode())
return;
// We don't want to show suggestions unless we are in insert mode.