From 87c42d92ebd493be6a04b2562480b70507d17a7f Mon Sep 17 00:00:00 2001 From: davco01a Date: Thu, 4 Jun 2020 13:52:00 -0400 Subject: [PATCH 1/2] fix for issue 625 --- src/main/java/application/rest/StackUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/application/rest/StackUtils.java b/src/main/java/application/rest/StackUtils.java index b41baf2..eb06e32 100644 --- a/src/main/java/application/rest/StackUtils.java +++ b/src/main/java/application/rest/StackUtils.java @@ -442,9 +442,12 @@ public static String digestCheck(String kabDigest, String imageDigest, String st System.out.println("Could not find one of the digests. Kab digest="+kabDigest+", imageDigest="+imageDigest); digestCheck="unknown"; } - - status=status.substring(0, 6); - if (!"active".contentEquals(status)) { + if (status!=null) { + status=status.substring(0, 6); + if (!"active".contentEquals(status)) { + digestCheck = "NA"; + } + } else { digestCheck = "NA"; } return digestCheck; From e911d87a58058602e7196949e3f0534f1a22febb Mon Sep 17 00:00:00 2001 From: davco01a Date: Thu, 4 Jun 2020 14:24:17 -0400 Subject: [PATCH 2/2] fix the fix --- src/main/java/application/rest/StackUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/application/rest/StackUtils.java b/src/main/java/application/rest/StackUtils.java index eb06e32..f17d304 100644 --- a/src/main/java/application/rest/StackUtils.java +++ b/src/main/java/application/rest/StackUtils.java @@ -443,8 +443,12 @@ public static String digestCheck(String kabDigest, String imageDigest, String st digestCheck="unknown"; } if (status!=null) { - status=status.substring(0, 6); - if (!"active".contentEquals(status)) { + if (status.contains("active")) { + status=status.substring(0, 6); + if (!"active".contentEquals(status)) { + digestCheck = "NA"; + } + } else { digestCheck = "NA"; } } else {