You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2018/11/19 18:04:51 UTC

[mynewt-newt] 02/02: sysinit: Don't use unintialized result on failure

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 244753a7f697fc9c08c0cc93760144dff37566ee
Author: Christopher Collins <cc...@apache.org>
AuthorDate: Fri Nov 16 10:49:19 2018 -0800

    sysinit: Don't use unintialized result on failure
---
 newt/sysinit/sysinit.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/newt/sysinit/sysinit.go b/newt/sysinit/sysinit.go
index a3b8dfd..dd270de 100644
--- a/newt/sysinit/sysinit.go
+++ b/newt/sysinit/sysinit.go
@@ -49,9 +49,9 @@ func (scfg *SysinitCfg) readOnePkg(lpkg *pkg.LocalPackage, cfg *syscfg.Cfg) {
 		sf, err := stage.NewStageFunc(name, stageStr, lpkg, cfg)
 		if err != nil {
 			scfg.InvalidSettings = append(scfg.InvalidSettings, err.Error())
+		} else {
+			scfg.StageFuncs = append(scfg.StageFuncs, sf)
 		}
-
-		scfg.StageFuncs = append(scfg.StageFuncs, sf)
 	}
 }