From 59c824540ce6c370f2755873fbb2571486534e7e Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Mon, 9 Mar 2020 07:34:59 -0700 Subject: [PATCH] Merge pull request #7231 from hashicorp/b-alloc-dev-panic api: fix panic when displaying devices w/o stat --- CHANGELOG.md | 1 + api/nodes.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a77a1817bd..e72f12adb33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ SECURITY: BUG FIXES: * api: Fixed a panic when canonicalizing a jobspec with an incorrect job type [[GH-7207]](https://github.com/hashicorp/nomad/pull/7207) + * cli: Fixed a panic when displaying device plugins without stats [[GH-7231](https://github.com/hashicorp/nomad/issues/7231)] ## 0.10.4 (February 19, 2020) diff --git a/api/nodes.go b/api/nodes.go index 4a264eb4d33..6a5adf977c0 100644 --- a/api/nodes.go +++ b/api/nodes.go @@ -676,6 +676,8 @@ type StatValue struct { func (v *StatValue) String() string { switch { + case v == nil: + return "" case v.BoolVal != nil: return strconv.FormatBool(*v.BoolVal) case v.StringVal != nil: