diff options
Diffstat (limited to 'interfaces-model.lua')
-rw-r--r-- | interfaces-model.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/interfaces-model.lua b/interfaces-model.lua index 776cd6f..bfa9bb8 100644 --- a/interfaces-model.lua +++ b/interfaces-model.lua @@ -280,11 +280,14 @@ iface.add_after = function (def, name) end iface.read = function (name) - -- if the name is blank, then return nil + -- if the name is blank, then return a blank iface with error iface.unpack_interfaces() local rc, idx = iface.index(name) if rc == false then - return nil + local ret = iface.iface_type() + ret.value.name.value = name + ret.value.name.errtxt = "Interface does not exist" + return ret end return iface.array[idx] end |