From 1c946ef0038a27d134f497ed72352136c0a4bb9e Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Fri, 24 May 2013 13:03:09 +0000 Subject: [PATCH] fix: Can't lookup root of unregistered image --- graph.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph.go b/graph.go index 85a33a32a5..86c12b8f8b 100644 --- a/graph.go +++ b/graph.go @@ -89,6 +89,7 @@ func (graph *Graph) Get(name string) (*Image, error) { if img.Id != id { return nil, fmt.Errorf("Image stored at '%s' has wrong id '%s'", id, img.Id) } + img.graph = graph if img.Size == 0 { root, err := img.root() if err != nil { @@ -98,7 +99,6 @@ func (graph *Graph) Get(name string) (*Image, error) { return nil, err } } - img.graph = graph graph.lockSumMap.Lock() defer graph.lockSumMap.Unlock() if _, exists := graph.checksumLock[img.Id]; !exists {