'Undo History' panel crashing at the beginning of a file

Summary:

There's some instability within the undo history panel that can be reproduced while trying to use it at the beginning of a file. This seems to be somewhat related to the inability to undo past a certain "point", which is easily reproducible with a new clean file.

Steps to reproduce:

  1. Open inkscape, select one tool like the rectangle tool.
  2. Draw any number of shapes.
  3. Open the undo history panel and select any previous step
  4. draw a new rectangle = crashes Peek_10-07-2022_04-16

Version info

Inkscape 1.2 (dc2aedaf03, 2022-05-15)

GLib version:     2.72.2
GTK version:      3.24.34
glibmm version:   2.66.1
gtkmm version:    3.24.5
libxml2 version:  2.9.12
libxslt version:  1.1.34
Cairo version:    1.16.0
Pango version:    1.50.7
HarfBuzz version: 3.0.0

OS version:       GNOME 42 (Flatpak runtime)

Ubuntu 22.04