Protect against null pointer use.

Fixes #13349
https://gitlab.com/kicad/code/kicad/issues/13349
This commit is contained in:
jean-pierre charras 2023-01-02 15:42:49 +01:00
parent 20f2232d4e
commit 40e41d0129
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -127,8 +127,11 @@ bool TOOLS_HOLDER::IsCurrentTool( const TOOL_ACTION& aAction ) const
void TOOLS_HOLDER::ShowChangedLanguage() void TOOLS_HOLDER::ShowChangedLanguage()
{ {
if( !GetToolManager() )
return;
std::string actionName = CurrentToolName(); std::string actionName = CurrentToolName();
TOOL_ACTION* action = m_toolManager->GetActionManager()->FindAction( actionName ); TOOL_ACTION* action = GetToolManager()->GetActionManager()->FindAction( actionName );
if( action ) if( action )
DisplayToolMsg( action->GetLabel() ); DisplayToolMsg( action->GetLabel() );