Check if master Bridge exists when LinkSetMaster

This commit is contained in:
Hubert Krauze 2015-12-09 12:25:52 +01:00
parent 2f58676854
commit a88e39d806

View File

@ -133,6 +133,9 @@ func LinkSetMaster(link Link, master *Bridge) error {
ensureIndex(masterBase)
index = masterBase.Index
}
if index <= 0 {
return fmt.Errorf("Device does not exist")
}
return LinkSetMasterByIndex(link, index)
}