Skip to content

Commit a35a770

Browse files
committed
return immediately on error
Signed-off-by: Espen Suenson <[email protected]>
1 parent ee88050 commit a35a770

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

store.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ func (c *controller) getStores() []datastore.DataStore {
8181

8282
func (c *controller) getNetworkFromStore(nid string) (*network, error) {
8383
ns, err := c.getNetworksFromStore()
84+
if err != nil {
85+
return nil, err
86+
}
8487
for _, n := range ns {
8588
if n.id == nid {
86-
return n, err
89+
return n, nil
8790
}
8891
}
8992
return nil, fmt.Errorf("network %s not found", nid)

0 commit comments

Comments
 (0)