eeschema segfault when draw wire (lp:#1826155)

[Original report](https://bugs.launchpad.net/bugs/1826155) created by **Martin Thomas (mtlaunchpad)**
```
When I draw a wire in the hierarchical sheet it results in an segfault.


Application: kicad
Version: (5.1.0-345-g18af61dde), debug build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 GnuTLS/3.5.8 zlib/1.2.8 libidn2/0.16 libpsl/0.17.0
(+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.19.34-mt x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.62.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.52.1
    Compiler: GCC 6.3.0 with C++ ABI 1010

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=OFF






[Thread 0x7fffda7fc700 (LWP 24829) exited]
[Thread 0x7fffdb7fe700 (LWP 24830) exited]
11:18:25: Debug: Disabling glCopyBuffer() on intel GPU

[Thread 0x7fffdaffd700 (LWP 24810) exited]

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fffc6b6973d in SCH_LINE::SetEndPoint (this=0x0, aPosition=...)
    at /home/mthomas/daten/git/kicad/kicad-source-
mirror/eeschema/./sch_line.h:82
82          void SetEndPoint( const wxPoint& aPosition ) { m_end =
aPosition; }
(gdb) b
Breakpoint 1 at 0x7fffc6b6973d: file /home/mthomas/daten/git/kicad/kicad-
source-mirror/eeschema/./sch_line.h, line 82.
(gdb) backtrace
#0  0x00007fffc6b6973d in SCH_LINE::SetEndPoint (this=0x0, aPosition=...)
    at /home/mthomas/daten/git/kicad/kicad-source-
mirror/eeschema/./sch_line.h:82
#1  0x00007fffc6d3ef76 in SCH_DRAWING_TOOL::doDrawSegments
(this=0x5555583b5910, aType=139, aSegment=0x0)
    at /home/mthomas/daten/git/kicad/kicad-source-
mirror/eeschema/tools/sch_drawing_tool.cpp:982
#2  0x00007fffc6d3d775 in SCH_DRAWING_TOOL::DrawWire (this=0x5555583b5910,
aEvent=...)
    at /home/mthomas/daten/git/kicad/kicad-source-
mirror/eeschema/tools/sch_drawing_tool.cpp:653
#3  0x00007fffc6d486b1 in std::__invoke_impl<int, int (SCH_DRAWING_TOOL::*
const&)(TOOL_EVENT const&), SCH_DRAWING_TOOL*&, TOOL_EVENT const&> (__f=
   @ 0x55555908d830: (int (SCH_DRAWING_TOOL::*)(SCH_DRAWING_TOOL * const,
const TOOL_EVENT &)) 0x7fffc6d3d696 <SCH_DRAWING_TOOL::DrawWire(TOOL_EVENT
const&)>, __t=@0x55555908d840: 0x5555583b5910, __args#0=...) at
/usr/include/c++/6/functional:227
#4  0x00007fffc6d48546 in std::__invoke<int (SCH_DRAWING_TOOL::*
const&)(TOOL_EVENT const&), SCH_DRAWING_TOOL*&, TOOL_EVENT const&> (__fn=
   @ 0x55555908d830: (int (SCH_DRAWING_TOOL::*)(SCH_DRAWING_TOOL * const,
const TOOL_EVENT &)) 0x7fffc6d3d696 <SCH_DRAWING_TOOL::DrawWire(TOOL_EVENT
const&)>, __args#0=@0x55555908d840: 0x5555583b5910, __args#1=...) at
/usr/include/c++/6/functional:251
#5  0x00007fffc6d4843b in std::_Mem_fn_base<int
(SCH_DRAWING_TOOL::*)(TOOL_EVENT const&),
true>::operator()<SCH_DRAWING_TOOL*&, TOOL_EVENT const&>
(this=0x55555908d830, __args#0=@0x55555908d840: 0x5555583b5910,
__args#1=...) at /usr/include/c++/6/functional:604
#6  0x00007fffc6d481f9 in std::_Bind<std::_Mem_fn<int
(SCH_DRAWING_TOOL::*)(TOOL_EVENT const&)> (SCH_DRAWING_TOOL*,
std::_Placeholder<1>)>::__call<int, TOOL_EVENT const&, 0ul,
1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>)
(this=0x55555908d830,
    __args=<unknown type in /usr/local/bin/_eeschema.kiface, CU 0x2d64496,
DIE 0x2db86f5>) at /usr/include/c++/6/functional:934
#7  0x00007fffc6d47ddd in std::_Bind<std::_Mem_fn<int
(SCH_DRAWING_TOOL::*)(TOOL_EVENT const&)> (SCH_DRAWING_TOOL*,
std::_Placeholder<1>)>::operator()<TOOL_EVENT const&, int>(TOOL_EVENT
const&) (this=0x55555908d830, __args#0=...) at
/usr/include/c++/6/functional:993
#8  0x00007fffc6d4761e in std::_Function_handler<int (TOOL_EVENT const&),
std::_Bind<std::_Mem_fn<int (SCH_DRAWING_TOOL::*)(TOOL_EVENT const&)>
(SCH_DRAWING_TOOL*, std::_Placeholder<1>)> >::_M_invoke(std::_Any_data
const&, TOOL_EVENT const&) (__functor=..., __args#0=...)
    at /usr/include/c++/6/functional:1717
#9  0x00007fffc6ef2ca3 in std::function<int (TOOL_EVENT
const&)>::operator()(TOOL_EVENT const&) const (this=0x5555595a42a8,
__args#0=...)
    at /usr/include/c++/6/functional:2127
#10 0x00007fffc6eefb21 in COROUTINE<int, TOOL_EVENT const&>::callerStub
(aData=140737488335456)
    at /home/mthomas/daten/git/kicad/kicad-source-
mirror/include/tool/coroutine.h:331
#11 0x00007fffc6f521b1 in make_fcontext () from
/usr/local/bin/_eeschema.kiface
#12 0x0000000000000000 in ?? ()
```

Story points: 6.0