diff --git a/pcbnew/tools/pcb_control.cpp b/pcbnew/tools/pcb_control.cpp index f130d2a981..2e0d56e10a 100644 --- a/pcbnew/tools/pcb_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -1773,7 +1773,7 @@ int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) } } - if( ( a->HasHole() || b->HasHole() ) ) + if( a && b && ( a->HasHole() || b->HasHole() ) ) { PCB_LAYER_ID active = m_frame->GetActiveLayer(); PCB_LAYER_ID layer = UNDEFINED_LAYER;