Skip to content
Snippets Groups Projects
Commit df582f88 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

CppEditor: Fix potential null pointer dereference


Detected by Address Sanitizer.

Change-Id: Ieab9c201e1fe6a7cf5c32747b2ce3d4562f4e598
Reviewed-by: default avatarOrgad Shaneh <orgads@gmail.com>
parent 9b30795c
No related merge requests found
...@@ -291,7 +291,9 @@ ExtensionSystem::IPlugin::ShutdownFlag CppEditorPlugin::aboutToShutdown() ...@@ -291,7 +291,9 @@ ExtensionSystem::IPlugin::ShutdownFlag CppEditorPlugin::aboutToShutdown()
static CppEditorWidget *currentCppEditorWidget() static CppEditorWidget *currentCppEditorWidget()
{ {
return qobject_cast<CppEditorWidget*>(EditorManager::currentEditor()->widget()); if (IEditor *currentEditor = EditorManager::currentEditor())
return qobject_cast<CppEditorWidget*>(currentEditor->widget());
return 0;
} }
void CppEditorPlugin::switchDeclarationDefinition() void CppEditorPlugin::switchDeclarationDefinition()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment