diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java index d40b4740d60..6247773004f 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java @@ -160,6 +160,10 @@ public List queryComponentsStatus() { } private StatusPageHistory combineOneDayStatusPageHistory(List statusPageHistories, StatusPageComponent component, long nowTimestamp) { + if (statusPageHistories.isEmpty()) { + return StatusPageHistory.builder().timestamp(nowTimestamp) + .normal(0).abnormal(0).unknown(0).componentId(component.getId()).state(component.getState()).build(); + } if (statusPageHistories.size() == 1) { return statusPageHistories.get(0); }