fix error handling when trying to open files

This commit is contained in:
2024-12-13 11:23:24 +01:00
parent a4be51f498
commit 31b27beee5
2 changed files with 19 additions and 8 deletions

View File

@@ -149,7 +149,9 @@ func ReadImage(filename string) (*bytes.Buffer, error) {
func fileExists(filename string) bool {
info, err := os.Stat(filename)
if os.IsNotExist(err) {
if err != nil {
// return false on any error
return false
}