From 229348853689b936b4bbdb907762abb619b6801f Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 7 Feb 2023 09:08:23 +0100 Subject: [PATCH] ClangCodeModel: prevent accessing nullptr There is a certain amount of time between resetting the processor to nullptr in ClangdFollowSymbol::VirtualFunctionAssistProcessor::cancel and the destruction of the ClangdFollowSymbol sentinel. So we also need to check the processor before calling update. Task-number: QTCREATORBUG-28769 Change-Id: Idec7c9dd7648285ecf2360c309d9751303f6209c Reviewed-by: Christian Kandeler Reviewed-by: Jarek Kobus --- src/plugins/clangcodemodel/clangdfollowsymbol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp index a34d02df21c..067858edef2 100644 --- a/src/plugins/clangcodemodel/clangdfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangdfollowsymbol.cpp @@ -453,7 +453,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult( const QString &name, const QString &prefix, const MessageId &reqId) { qCDebug(clangdLog) << "handling symbol info reply" << link.targetFilePath.toUserOutput() << link.targetLine; - if (!sentinel) + if (!sentinel || !virtualFuncAssistProcessor) return; if (!name.isEmpty()) symbolsToDisplay.push_back({prefix + name, link});