diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-06 17:53:09 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-08 01:29:35 +0200 |
| commit | df0e7490c3375e9b695ccd462b66f183fe954362 (patch) | |
| tree | 1191f1500047c70110f0a71d355e20f9929c4de9 /src | |
| parent | 71f9236b03ef8934d28d291f1d9f248137448e72 (diff) | |
Fix crash when using get_data() on new, empty choices.
Due to the dummy item that we have to add.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/dcpomatic_choice.cc | 3 |
1 files changed, 3 insertions, 0 deletions
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<string> Choice::get_data() const { + if (size() == 0) { + return {}; + } auto index = get(); if (!index) { |
