Previously, if FindModuleByPrefix() returns nil in Find(), it would continue to call module() with nil, resulting in a nil pointer dereference panic when trying to call ParentNode() from RootNode(). The fix is to return an error if FindModuleByPrefix() returns nil.
coverage: 83.677% (-0.08%) from 83.76% when pulling c1b2136ad52d1e6ca923fa4843463198e3276e1d on sengleung:find-panic-fix into 944052f4c47385554f2fb0f46ca4ecfbf446450c on openconfig:master.
Previously, if
FindModuleByPrefix()
returns nil inFind()
, it would continue to callmodule()
with nil, resulting in a nil pointer dereference panic when trying to callParentNode()
fromRootNode()
. The fix is to return an error ifFindModuleByPrefix()
returns nil.Fixes #251