Skip to content

Commit 79702c5

Browse files
authored
fix: account for recheck value could be null (#1738)
1 parent 57e3168 commit 79702c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/com/aws/greengrass/lifecyclemanager/UpdateSystemPolicyService.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,17 @@ private long getTimeToReCheck(long timeout, String deploymentId,
209209
try {
210210
DeferComponentUpdateRequest deferRequest = fut.get();
211211
if (deploymentId.equals(deferRequest.getDeploymentId())) {
212-
long timeToRecheck = currentTimeMillis + deferRequest.getRecheckAfterMs();
212+
Long recheckAfterMs = deferRequest.getRecheckAfterMs();
213+
if (recheckAfterMs == null) {
214+
logger.atWarn().log("Deferral request contains null value, ignoring...");
215+
continue;
216+
}
217+
long timeToRecheck = currentTimeMillis + recheckAfterMs;
213218
if (timeToRecheck > maxTimeToReCheck) {
214219
maxTimeToReCheck = timeToRecheck;
215220
logger.atInfo().setEventType("service-update-deferred")
216221
.log("deferred for {} millis with message {}",
217-
deferRequest.getRecheckAfterMs(),
222+
recheckAfterMs,
218223
deferRequest.getMessage());
219224
}
220225
} else {

0 commit comments

Comments
 (0)