Преглед на файлове

fix: Can't lookup root of unregistered image

Victor Vieux преди 12 години
родител
ревизия
1c946ef003
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      graph.go

+ 1 - 1
graph.go

@@ -89,6 +89,7 @@ func (graph *Graph) Get(name string) (*Image, error) {
 	if img.Id != id {
 	if img.Id != id {
 		return nil, fmt.Errorf("Image stored at '%s' has wrong id '%s'", id, img.Id)
 		return nil, fmt.Errorf("Image stored at '%s' has wrong id '%s'", id, img.Id)
 	}
 	}
+	img.graph = graph
 	if img.Size == 0 {
 	if img.Size == 0 {
 		root, err := img.root()
 		root, err := img.root()
 		if err != nil {
 		if err != nil {
@@ -98,7 +99,6 @@ func (graph *Graph) Get(name string) (*Image, error) {
 			return nil, err
 			return nil, err
 		}
 		}
 	}
 	}
-	img.graph = graph
 	graph.lockSumMap.Lock()
 	graph.lockSumMap.Lock()
 	defer graph.lockSumMap.Unlock()
 	defer graph.lockSumMap.Unlock()
 	if _, exists := graph.checksumLock[img.Id]; !exists {
 	if _, exists := graph.checksumLock[img.Id]; !exists {