eeschema: Segfault moving/placing a component

Description

A segfault happened when left-clicking to place a component (in fact I think I first misplaced it and was moving it, but I'm not 100% sure of this). I don't know if this is relevant to the crash, but I was placing the component exactly on top of another copy of the same symbol which had been edited in schematic only to change some pin types.

Backtrace

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fffcd66b385 in LIB_PART::Compare (this=0x0, aRhs=...) at /usr/include/c++/10.2.0/bits/shared_ptr_base.h:1324
1324	      get() const noexcept
(gdb) bt
#0  0x00007fffcd66b385 in LIB_PART::Compare(LIB_PART const&) const (this=0x0, aRhs=...) at /usr/include/c++/10.2.0/bits/shared_ptr_base.h:1324
#1  0x00007fffcd79aca7 in LIB_PART::operator!=(LIB_PART const&) const (aPart=<optimized out>, this=<optimized out>) at /home/sliedes/scratch/build/kicad/kicad/eeschema/./class_libentry.h:605
#2  SCH_SCREEN::Append(SCH_ITEM*) (this=this@entry=0x5555591cec00, aItem=aItem@entry=0x555556bff600) at /home/sliedes/scratch/build/kicad/kicad/eeschema/sch_screen.cpp:157
#3  0x00007fffcd7246da in SCH_BASE_FRAME::AddToScreen(EDA_ITEM*, SCH_SCREEN*) (this=this@entry=0x555558cde6a0, aItem=aItem@entry=0x555556bff600, aScreen=aScreen@entry=0x5555591cec00) at /home/sliedes/scratch/build/kicad/kicad/eeschema/sch_base_frame.cpp:369
#4  0x00007fffcd7fecce in SCH_EDIT_FRAME::AddItemToScreenAndUndoList(SCH_SCREEN*, SCH_ITEM*, bool) (this=0x555558cde6a0, aScreen=0x5555591cec00, aItem=0x555556bff600, aUndoAppend=<optimized out>) at /home/sliedes/scratch/build/kicad/kicad/eeschema/sch_edit_frame.cpp:1188
#5  0x00007fffcd88055c in SCH_DRAWING_TOOLS::PlaceComponent(TOOL_EVENT const&) (this=0x555556180d80, aEvent=<optimized out>) at /home/sliedes/scratch/build/kicad/kicad/eeschema/tools/sch_drawing_tools.cpp:221
#6  0x00007fffcdae1490 in std::function<int (TOOL_EVENT const&)>::operator()(TOOL_EVENT const&) const (__args#0=<optimized out>, this=0x55556b2ec050) at /usr/include/c++/10.2.0/bits/std_function.h:622
#7  COROUTINE<int, TOOL_EVENT const&>::callerStub(long) (aData=<optimized out>) at /home/sliedes/scratch/build/kicad/kicad/include/tool/coroutine.h:351
#8  0x0000555555843671 in make_fcontext ()
#9  0x0000000000000000 in  ()

KiCad Version

Application: Eeschema

Version: (5.99.0-8567-g25956152c6), release build

Libraries:
	wxWidgets 3.0.5
	libcurl/7.74.0 OpenSSL/1.1.1i zlib/1.2.11 zstd/1.4.8 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.41.0

Platform: Linux 5.10.5-arch1-1 x86_64, 64 bit, Little endian, wxGTK, KDE, x11

Build Info:
	Date: Jan 24 2021 01:25:05
	wxWidgets: 3.0.5 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
	Boost: 1.75.0
	OCC: 7.5.0
	Curl: 7.74.0
	ngspice: 33
	Compiler: GCC 10.2.0 with C++ ABI 1014

Build settings:
	KICAD_SCRIPTING=ON
	KICAD_SCRIPTING_MODULES=ON
	KICAD_SCRIPTING_PYTHON3=ON
	KICAD_SCRIPTING_WXPYTHON=ON
	KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
	KICAD_SCRIPTING_ACTION_MENU=ON
	KICAD_USE_OCC=ON
	KICAD_SPICE=ON