diff --git a/dialog/file_xdg.go b/dialog/file_xdg.go index 1574853825..dd16a02866 100644 --- a/dialog/file_xdg.go +++ b/dialog/file_xdg.go @@ -78,6 +78,7 @@ func getFavoriteLocations() (map[string]fyne.ListableURI, error) { func fileOpenOSOverride(d *FileDialog) bool { go func() { + folderCallback, folder := d.callback.(func(fyne.ListableURI, error)) options := &filechooser.OpenOptions{ Modal: true, Directory: folder, @@ -87,7 +88,6 @@ func fileOpenOSOverride(d *FileDialog) bool { options.Location = d.startingLocation.Path() } - folderCallback, folder := d.callback.(func(fyne.ListableURI, error)) if folder { uris, err := filechooser.OpenFile("", "Open Folder", options) if err != nil {