From df0e7490c3375e9b695ccd462b66f183fe954362 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 6 May 2025 17:53:09 +0200 Subject: Fix crash when using get_data() on new, empty choices. Due to the dummy item that we have to add. --- src/wx/dcpomatic_choice.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/wx/dcpomatic_choice.cc b/src/wx/dcpomatic_choice.cc index 5b3b9fb48..270ab72ad 100644 --- a/src/wx/dcpomatic_choice.cc +++ b/src/wx/dcpomatic_choice.cc @@ -144,6 +144,9 @@ Choice::get() const optional Choice::get_data() const { + if (size() == 0) { + return {}; + } auto index = get(); if (!index) { -- cgit v1.2.3