Skip to content

Commit d38225d

Browse files
committed
make sure to check the URI for nil since even when cancel button is click the callback function is invoked.
1 parent d09a812 commit d38225d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/guimain/fyne.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,13 @@ func (a *GetGo) Init(w fyne.Window) {
116116
func() {
117117
dialog.ShowFolderOpen(
118118
func(uri fyne.ListableURI, err error) {
119+
if uri == nil || err != nil {
120+
return
121+
}
119122
// TODO: Should look into data binding for these fields.
120123
a.savepath = uri.Path()
121124
a.lblSavePath.SetText(uri.Path())
122-
}, a.parent)
123-
125+
}, w)
124126
},
125127
)
126128

0 commit comments

Comments
 (0)