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 2016/12/19 22:09:32 UTC

[2/2] incubator-mynewt-newt git commit: Newt - Fix ChildNewtError() panic.

Newt - Fix ChildNewtError() panic.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/856ea2f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/856ea2f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/856ea2f0

Branch: refs/heads/develop
Commit: 856ea2f0f25061b453dbe82b456a03a2353411ea
Parents: 483b0a6
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Dec 19 14:09:14 2016 -0800
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Dec 19 14:09:14 2016 -0800

----------------------------------------------------------------------
 newt/vendor/mynewt.apache.org/newt/util/util.go | 2 +-
 util/util.go                                    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/856ea2f0/newt/vendor/mynewt.apache.org/newt/util/util.go
----------------------------------------------------------------------
diff --git a/newt/vendor/mynewt.apache.org/newt/util/util.go b/newt/vendor/mynewt.apache.org/newt/util/util.go
index d734174..e3ff437 100644
--- a/newt/vendor/mynewt.apache.org/newt/util/util.go
+++ b/newt/vendor/mynewt.apache.org/newt/util/util.go
@@ -92,7 +92,7 @@ func PreNewtError(err error, format string, args ...interface{}) *NewtError {
 func ChildNewtError(parent error) *NewtError {
 	for {
 		newtErr, ok := parent.(*NewtError)
-		if !ok {
+		if !ok || newtErr == nil || newtErr.Parent == nil {
 			break
 		}
 		parent = newtErr.Parent

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/856ea2f0/util/util.go
----------------------------------------------------------------------
diff --git a/util/util.go b/util/util.go
index d734174..e3ff437 100644
--- a/util/util.go
+++ b/util/util.go
@@ -92,7 +92,7 @@ func PreNewtError(err error, format string, args ...interface{}) *NewtError {
 func ChildNewtError(parent error) *NewtError {
 	for {
 		newtErr, ok := parent.(*NewtError)
-		if !ok {
+		if !ok || newtErr == nil || newtErr.Parent == nil {
 			break
 		}
 		parent = newtErr.Parent