Symbol Editor: "Edit Spice Model..." causes crash (lp:#1811519)

[Original report](https://bugs.launchpad.net/bugs/1811519) created by **Thomas Pointhuber (pointhi)**
```
# HowTo reproduce

1. Select "4xxx:4001" as the model (should reproduce with the others as
well) in the "Symbol Editor"
2. "Library Symbol Properties" -> "Edit Spice Model..."
3. crash

Thread 1 "kicad" received signal SIGSEGV, Segmentation fault.
0x00007fffdddba3b8 in EDA_ITEM::operator= (this=0x7fffffff9080, aItem=...)
at ./kicad-src/common/base_struct.cpp:251
251         m_StructType = aItem.m_StructType;
(gdb) bt
#0  0x00007fffdddba3b8 in EDA_ITEM::operator=(EDA_ITEM const&)
(this=0x7fffffff9080, aItem=...) at ./kicad-src/common/base_struct.cpp:251
#1  0x00007fffdddba365 in EDA_ITEM::EDA_ITEM(EDA_ITEM const&)
(this=0x7fffffff9080, base=...) at ./kicad-src/common/base_struct.cpp:82
#2  0x00007fffddc02a9f in SCH_ITEM::SCH_ITEM(SCH_ITEM const&)
(this=0x7fffffff9080, aItem=...) at ./kicad-
src/eeschema/sch_item_struct.cpp:55
#3  0x00007fffdd97495f in SCH_FIELD::SCH_FIELD(SCH_FIELD const&)
(this=0x7fffffff9080) at ./kicad-src/eeschema/./sch_field.h:56
#4  0x00007fffddcfcf76 in DIALOG_SPICE_MODEL::TransferDataToWindow()
(this=0x7fffffff9690) at ./kicad-
src/eeschema/dialogs/dialog_spice_model.cpp:269
#5  0x00007fffddd03e5c in DIALOG_SPICE_MODEL::onInitDlg(wxInitDialogEvent&)
(this=0x7fffffff9690, event=...) at ./kicad-
src/eeschema/./dialogs/dialog_spice_model.h:99
#6  0x00007ffff66ac6fe in
wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.1.so.1
#7  0x00007ffff66acc91 in wxEvtHandler::SearchDynamicEventTable(wxEvent&)
() at /usr/lib/libwx_baseu-3.1.so.1
#8  0x00007ffff66acf3f in wxEvtHandler::TryHereOnly(wxEvent&) () at
/usr/lib/libwx_baseu-3.1.so.1
#9  0x00007ffff66acfda in wxEvtHandler::ProcessEventLocally(wxEvent&) () at
/usr/lib/libwx_baseu-3.1.so.1
#10 0x00007ffff66ad065 in wxEvtHandler::ProcessEvent(wxEvent&) () at
/usr/lib/libwx_baseu-3.1.so.1
#11 0x00007ffff6fedee4 in wxWindowBase::InitDialog() () at
/usr/lib/libwx_gtk3u_core-3.1.so.1
#12 0x00007ffff6e71d96 in wxDialog::Show(bool) () at
/usr/lib/libwx_gtk3u_core-3.1.so.1
#13 0x00007fffdddd39f3 in DIALOG_SHIM::Show(bool) (this=0x7fffffff9690,
show=true) at ./kicad-src/common/dialog_shim.cpp:184
#14 0x00007ffff6e71f41 in wxDialog::ShowModal() () at
/usr/lib/libwx_gtk3u_core-3.1.so.1
#15 0x00007fffdd959edb in
DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnEditSpiceModel(wxCommandEvent&)
(this=0x7fffffffbfc8, event=...)
    at ./kicad-src/eeschema/dialogs/dialog_edit_component_in_lib.cpp:573
#16 0x00007ffff66ac6fe in
wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&,
wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.1.so.1
#17 0x00007ffff66acc91 in wxEvtHandler::SearchDynamicEventTable(wxEvent&)
() at /usr/lib/libwx_baseu-3.1.so.1
#18 0x00007ffff66acf3f in wxEvtHandler::TryHereOnly(wxEvent&) () at
/usr/lib/libwx_baseu-3.1.so.1
#19 0x00007ffff66acfda in wxEvtHandler::ProcessEventLocally(wxEvent&) () at
/usr/lib/libwx_baseu-3.1.so.1
#20 0x00007ffff66ad065 in wxEvtHandler::ProcessEvent(wxEvent&) () at
/usr/lib/libwx_baseu-3.1.so.1
#21 0x00007ffff66aeb67 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () at
/usr/lib/libwx_baseu-3.1.so.1
#22 0x00007ffff6e66e16 in  () at /usr/lib/libwx_gtk3u_core-3.1.so.1
#23 0x00007ffff44eb16e in g_signal_emit_valist () at
/usr/lib/libgobject-2.0.so.0
#24 0x00007ffff44eba80 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#25 0x00007ffff4748aae in  () at /usr/lib/libgtk-3.so.0
#26 0x00007ffff4748b16 in  () at /usr/lib/libgtk-3.so.0
#27 0x00007ffff44fa3c5 in g_closure_invoke () at
/usr/lib/libgobject-2.0.so.0
#28 0x00007ffff44e7348 in  () at /usr/lib/libgobject-2.0.so.0
#29 0x00007ffff44eb01e in g_signal_emit_valist () at
/usr/lib/libgobject-2.0.so.0
#30 0x00007ffff44eba80 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#31 0x00007ffff4746f41 in  () at /usr/lib/libgtk-3.so.0
#32 0x00007ffff165f6d0 in ffi_call_unix64 () at /usr/lib/libffi.so.6
#33 0x00007ffff165f0a0 in ffi_call () at /usr/lib/libffi.so.6
#34 0x00007ffff4503e48 in g_cclosure_marshal_generic_va () at
/usr/lib/libgobject-2.0.so.0
#35 0x00007ffff44eb16e in g_signal_emit_valist () at
/usr/lib/libgobject-2.0.so.0
#36 0x00007ffff44eba80 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#37 0x00007ffff4810c1d in  () at /usr/lib/libgtk-3.so.0
#38 0x00007ffff4503a52 in g_cclosure_marshal_VOID__BOXEDv () at
/usr/lib/libgobject-2.0.so.0
#39 0x00007ffff44eb16e in g_signal_emit_valist () at
/usr/lib/libgobject-2.0.so.0
#40 0x00007ffff44eba80 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#41 0x00007ffff480dce3 in  () at /usr/lib/libgtk-3.so.0
#42 0x00007ffff480f353 in  () at /usr/lib/libgtk-3.so.0
#43 0x00007ffff4812267 in  () at /usr/lib/libgtk-3.so.0
#44 0x00007ffff47d9294 in gtk_event_controller_handle_event () at
/usr/lib/libgtk-3.so.0
#45 0x00007ffff499f024 in  () at /usr/lib/libgtk-3.so.0
#46 0x00007ffff49f58ec in  () at /usr/lib/libgtk-3.so.0
#47 0x00007ffff44fa3c5 in g_closure_invoke () at
/usr/lib/libgobject-2.0.so.0
#48 0x00007ffff44e699f in  () at /usr/lib/libgobject-2.0.so.0
#49 0x00007ffff44ea5ed in g_signal_emit_valist () at
/usr/lib/libgobject-2.0.so.0
#50 0x00007ffff44eba80 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#51 0x00007ffff49a1385 in  () at /usr/lib/libgtk-3.so.0

# Version Information

Application: kicad
Version: (6.0.0-rc1-dev-1530-gf5144eb5c), debug build
Libraries:
    wxWidgets 3.1.1
    libcurl/7.63.0 OpenSSL/1.1.1a zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2
(+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.35.1
Platform: Linux 4.20.0-arch1-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.1.1 (wchar_t,wx containers) GTK+ 3.24
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.62.0
    Compiler: Clang 7.0.1 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    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
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
```
Original tags: schematic-editor

Story points: 6.0