From 20dda9d5fdf1d5bb6b113557f926f675be495258 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 13 Jun 2024 08:55:47 +0200 Subject: [PATCH] FakeVim: Avoid possible nullptr access Amends 9f0919c4a3875d8baffc7b6f2b5f7d2e25e198c3. Fixes: QTCREATORBUG-30730 Change-Id: I389412a0b069fd34a625075d97c89f106c5b5f74 Reviewed-by: hjk --- src/plugins/fakevim/fakevimplugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/fakevim/fakevimplugin.cpp b/src/plugins/fakevim/fakevimplugin.cpp index a84598aec00..2ceb2ca30fe 100644 --- a/src/plugins/fakevim/fakevimplugin.cpp +++ b/src/plugins/fakevim/fakevimplugin.cpp @@ -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.