Check for toolbar before checking tool

Not all toolbars exist in all tools at all times.  Need to check before
dereferencing variable.

Fixes: lp:1754094
* https://bugs.launchpad.net/kicad/+bug/1754094
This commit is contained in:
Seth Hillbrand 2018-03-07 09:54:53 -08:00
parent 8fcbb64a46
commit 414e6614f1
1 changed files with 3 additions and 3 deletions

View File

@ -444,9 +444,9 @@ public:
*/ */
bool GetToolToggled( int aToolId ) bool GetToolToggled( int aToolId )
{ {
return ( m_mainToolBar->GetToolToggled( aToolId ) || return ( ( m_mainToolBar && m_mainToolBar->GetToolToggled( aToolId ) ) ||
m_optionsToolBar->GetToolToggled( aToolId ) || ( m_optionsToolBar && m_optionsToolBar->GetToolToggled( aToolId ) ) ||
m_drawToolBar->GetToolToggled( aToolId ) ); ( m_drawToolBar && m_drawToolBar->GetToolToggled( aToolId ) ) );
} }
/** /**