This is an automated email from the ASF dual-hosted git repository.

ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit 7bb99e866462ef485e1e659c9534fb9de5416d1b
Author: Christopher Collins <[email protected]>
AuthorDate: Mon Jan 27 11:03:03 2020 -0800

    config: Handle case where config tree lacks a root
---
 newt/config/tree.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/newt/config/tree.go b/newt/config/tree.go
index d7e3dc8..7750cb6 100644
--- a/newt/config/tree.go
+++ b/newt/config/tree.go
@@ -87,6 +87,11 @@ func BuildTree(entries []FileEntry) (*Node, error) {
                }
        }
 
+       if root == nil {
+               return nil, util.FmtNewtError(
+                       "failed to build a config tree: no root file")
+       }
+
        SortTree(root)
        return root, nil
 }

Reply via email to