eeschema: Don't segfault on empty drawlist

This commit is contained in:
Seth Hillbrand 2019-05-08 20:11:36 -07:00
parent 0e5f5d37d1
commit 589a37bfe8
1 changed files with 4 additions and 0 deletions

View File

@ -426,6 +426,10 @@ EDA_ITEM* SCH_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T
else
start = m_frame->GetScreen()->GetDrawItems();
// Empty schematics have no draw items
if( !start )
return nullptr;
collector.Collect( start, aFilterList, (wxPoint) aWhere, m_unit, m_convert );
bool anyCollected = collector.GetCount() != 0;