pcbnew: Check for valid pointer before deref
In legacy toolkit, we do not keep the corner pointers, so dereferencing causes crashes. Fixes: lp:1808852 * https://bugs.launchpad.net/kicad/+bug/1808852
This commit is contained in:
parent
93caff0ac1
commit
4aeef1e09e
|
@ -207,8 +207,10 @@ public:
|
|||
int GetSelectedCorner() const
|
||||
{
|
||||
// Transform relative indices to global index
|
||||
int globalIndex;
|
||||
m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
|
||||
int globalIndex = -1;
|
||||
|
||||
if( m_CornerSelection )
|
||||
m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex );
|
||||
|
||||
return globalIndex;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue