Crash on exporting schematic symbols to library.

Schematic editor crashes when exporting symbols to a library. I was fiddling a bit with updating an old project and after conversion to KiCad V7 the project got into a state where the symbol library: ${KIPRJMOD}/Library.pretty/Library.kicad_sym was already added to the project, but the library file itself does not exist. KiCad crashes when attempting to export symbols to this non existing file.

Steps to reproduce

  1. Extract attached project, open project, start schematic editor.
  2. File / Export / Symbols to Library
  3. Select: Library as output library (It is a symbol library inside the Library.pretty footprint library directory).
  4. Yes to: Update symbols in schematic to refer to new library? confirmation.
  5. Crash!

2023-12-25T21_25_mumar-base.zip

As a secondary issue (Create another issue for this? ) Schematic Editor / File / Export symbols to New Library and then attempting to use the Library.pretty/Library.kicad_sym location is refused by KiCad. I get a popup box with: Warning: Library 'Library' already exists I assume this is because the 'Library' already is in the sym-lib-table.

Application: KiCad x86_64 on x86_64

Version: 7.0.9-7.0.9~ubuntu20.04.1, release build

Libraries:
	wxWidgets 3.2.2
	FreeType 2.10.1
	HarfBuzz 6.0.0
	FontConfig 2.13.1

Platform: Linux Mint 20.3, 64 bit, Little endian, wxGTK, xfce, x11

	wxWidgets: 3.2.1 (wchar_t,wx containers) GTK+ 3.24
	Boost: 1.71.0
	OCC: 7.5.2
	Curl: 7.88.1
	ngspice: 38
	Compiler: GCC 9.4.0 with C++ ABI 1013

Build settings:
	KICAD_SPICE=ON
Edited by paulvdhoeven