Make sure a collector has a guide before handing it to a client filter.

Fixes https://gitlab.com/kicad/code/kicad/issues/12460

(cherry picked from commit 1566bd8b14)
This commit is contained in:
Jeff Young 2022-09-18 18:14:08 +01:00
parent c94de31a8c
commit 0704e37eb5
1 changed files with 3 additions and 0 deletions

View File

@ -522,8 +522,11 @@ PCB_SELECTION& PCB_SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCl
enum DISPOSITION { BEFORE = 1, AFTER, BOTH };
std::map<EDA_ITEM*, DISPOSITION> itemDispositions;
GENERAL_COLLECTORS_GUIDE guide = getCollectorsGuide();
GENERAL_COLLECTOR collector;
collector.SetGuide( &guide );
for( EDA_ITEM* item : m_selection )
{
collector.Append( item );