check err just in case

This commit is contained in:
piotr
2021-08-20 05:02:37 +02:00
parent 6912e7f320
commit 04a292c2ec
2 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@@ -650,8 +650,8 @@ func open(filePath string, xdgOpen bool) {
cmd = exec.Command("xdg-open", filePath) cmd = exec.Command("xdg-open", filePath)
// Look for possible custom file association // Look for possible custom file association
for key, element := range preferredApps { for key, element := range preferredApps {
r, _ := regexp.Compile(key) r, err := regexp.Compile(key)
if r.MatchString(filePath) { if err == nil && r.MatchString(filePath) {
cmd = exec.Command(fmt.Sprintf("%v", element), filePath) cmd = exec.Command(fmt.Sprintf("%v", element), filePath)
break break
} }
@@ -659,7 +659,7 @@ func open(filePath string, xdgOpen bool) {
} else { } else {
cmd = exec.Command(*fileManager, filePath) cmd = exec.Command(*fileManager, filePath)
} }
fmt.Println(cmd) fmt.Printf("Executing: %s", cmd)
cmd.Start() cmd.Start()
gtk.MainQuit() gtk.MainQuit()