Skip to content

Commit

Permalink
Handle cancelled dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Nov 19, 2023
1 parent a697c02 commit 1c0ccb2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dialog/file_xdg.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ func fileOpenOSOverride(d *FileDialog) bool {
folderCallback(nil, err)
}

if len(uris) == 0 {
folderCallback(nil, nil)
return
}

uri, err := storage.ParseURI(uris[0])
if err != nil {
folderCallback(nil, err)
Expand All @@ -104,6 +109,11 @@ func fileOpenOSOverride(d *FileDialog) bool {
return
}

if len(uris) == 0 {
folderCallback(nil, nil)
return
}

uri, err := storage.ParseURI(uris[0])
if err != nil {
fileCallback(nil, err)
Expand All @@ -124,6 +134,11 @@ func fileSaveOSOverride(d *FileDialog) bool {
return
}

if len(uris) == 0 {
callback(nil, nil)
return
}

uri, err := storage.ParseURI(uris[0])
if err != nil {
callback(nil, err)
Expand Down

0 comments on commit 1c0ccb2

Please sign in to comment.