Skip to content

Commit b66c038

Browse files
committed
Merge pull request #1172 from aboch/cap
Protect cap access in driver()
2 parents 3e0947f + 6ca1974 commit b66c038

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

network.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,10 @@ func (n *network) driver(load bool) (driverapi.Driver, error) {
665665

666666
c := n.getController()
667667
n.Lock()
668-
n.scope = cap.DataScope
668+
// If load is not required, driver, cap and err may all be nil
669+
if cap != nil {
670+
n.scope = cap.DataScope
671+
}
669672
if c.cfg.Daemon.IsAgent {
670673
// If we are running in agent mode then all networks
671674
// in libnetwork are local scope regardless of the

0 commit comments

Comments
 (0)