From 589a37bfe8c773d621b6dae9a0f3347babaf1ba1 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 8 May 2019 20:11:36 -0700 Subject: [PATCH] eeschema: Don't segfault on empty drawlist --- eeschema/tools/sch_selection_tool.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eeschema/tools/sch_selection_tool.cpp b/eeschema/tools/sch_selection_tool.cpp index 9ea4574062..81633bb8a1 100644 --- a/eeschema/tools/sch_selection_tool.cpp +++ b/eeschema/tools/sch_selection_tool.cpp @@ -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;