Commit 2b9895f2 authored by Hubert Figuière's avatar Hubert Figuière
Browse files

ui: fix crash if there is no previously open soundfont

parent 3ff0b270
......@@ -75,14 +75,10 @@ impl ObjectImpl for FileChooserButtonPriv {
let priv_ = FileChooserButtonPriv::from_instance(b);
// We must hold a reference to the Native dialog, or it crashes.
.and_then(|f| f.parent())
let current_folder = priv_.file.borrow().as_ref().and_then(|f| f.parent());
if current_folder.is_some() {
file_chooser.connect_response(glib::clone!(@weak b => move |w, r| {
if r == gtk4::ResponseType::Accept {
b.set_property("file", &w.file());
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment