浏览代码

daemon: filterByNameIDMatches() fix error handling

Probably not critical, but we shouldn't use the data that's
returned if there's an error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 3 年之前
父节点
当前提交
ddaba6d576
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      daemon/list.go

+ 4 - 1
daemon/list.go

@@ -119,8 +119,11 @@ func (daemon *Daemon) filterByNameIDMatches(view *container.View, filter *listCo
 		// standard behavior of walking the entire container
 		// list from the daemon's in-memory store
 		all, err := view.All()
+		if err != nil {
+			return nil, err
+		}
 		sort.Sort(byCreatedDescending(all))
-		return all, err
+		return all, nil
 	}
 
 	// idSearch will determine if we limit name matching to the IDs