Skip to content

Commit

Permalink
handle error when opening an image file
Browse files Browse the repository at this point in the history
  • Loading branch information
fpabl0 committed Mar 6, 2021
1 parent c253ac6 commit 8fa5af4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/painter/image.go
Expand Up @@ -39,7 +39,11 @@ func PaintImage(img *canvas.Image, c fyne.Canvas, width, height int) image.Image
isSVG = isResourceSVG(img.Resource)
} else {
name = img.File
handle, _ := os.Open(img.File)
handle, err := os.Open(img.File)
if err != nil {
fyne.LogError("image load error", err)
return nil
}
defer handle.Close()
file = handle
isSVG = isFileSVG(img.File)
Expand Down

0 comments on commit 8fa5af4

Please sign in to comment.