tpl/images: Fix error handling in Config
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 18 May 2017 20:23:29 +0000 (23:23 +0300)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 18 May 2017 20:24:55 +0000 (23:24 +0300)
tpl/images/images.go

index 9244323b43794593159396ffa78ea842f3f9a4a9..d08033f2d2341b41362de10c7106c21213cb83be 100644 (file)
@@ -70,10 +70,13 @@ func (ns *Namespace) Config(path interface{}) (image.Config, error) {
        }
 
        config, _, err = image.DecodeConfig(f)
+       if err != nil {
+               return config, err
+       }
 
        ns.cacheMu.Lock()
        ns.cache[filename] = config
        ns.cacheMu.Unlock()
 
-       return config, err
+       return config, nil
 }