summaryrefslogtreecommitdiff
path: root/backend/filesystem/image.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/filesystem/image.go')
-rw-r--r--backend/filesystem/image.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/backend/filesystem/image.go b/backend/filesystem/image.go
index f1aa541..519dc1b 100644
--- a/backend/filesystem/image.go
+++ b/backend/filesystem/image.go
@@ -398,8 +398,11 @@ func (s *Store) ImageSnowflakeHash(flake string) (string, error) {
}
if !s.Compat {
- img, err := s.imageMetadataRead(s.ImageSnowflakePath(flake) + "/" + infoJson)
- return img.Hash, err
+ if img, err := s.imageMetadataRead(s.ImageSnowflakePath(flake) + "/" + infoJson); err != nil {
+ return "", err
+ } else {
+ return img.Hash, nil
+ }
} else {
if path, err := os.ReadFile(s.ImageSnowflakePath(flake)); err != nil {
if os.IsNotExist(err) {
@@ -408,8 +411,11 @@ func (s *Store) ImageSnowflakeHash(flake string) (string, error) {
return "", err
} else {
var img *store.Image
- img, err = s.imageMetadataRead(string(path) + "/" + infoJson)
- return img.Hash, err
+ if img, err = s.imageMetadataRead(string(path) + "/" + infoJson); err != nil {
+ return "", err
+ } else {
+ return img.Hash, nil
+ }
}
}
}