This is an automated email from the ASF dual-hosted git repository.

gongchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new e06350809 [bugfix] fix statuspage index exception (#1747)
e06350809 is described below

commit e06350809a491660ca874a13d7a935a22b161189
Author: makechoicenow <[email protected]>
AuthorDate: Mon Apr 15 18:10:10 2024 +0800

    [bugfix] fix statuspage index exception (#1747)
    
    Co-authored-by: zhouge <[email protected]>
---
 .../apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java  | 4 ++++
 1 file changed, 4 insertions(+)

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 d40b4740d..624777300 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 class StatusPageServiceImpl implements 
StatusPageService {
     }
     
     private StatusPageHistory 
combineOneDayStatusPageHistory(List<StatusPageHistory> 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);
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to