Skip to content

Commit

Permalink
fix clipboard panic
Browse files Browse the repository at this point in the history
  • Loading branch information
pete911 committed Jul 5, 2023
1 parent fc3aaaa commit c668bb7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ func getBoolEnv(envName string, defaultValue bool) bool {
return defaultValue
}

func isClipboardSupported() bool {
func isClipboardSupported() (ok bool) {
defer func() {
if err := recover(); err != nil {
ok = false
}
}()
return clipboard.Init() == nil
}

0 comments on commit c668bb7

Please sign in to comment.