Duansg opened a new pull request, #3448:
URL: https://github.com/apache/hertzbeat/pull/3448

   ## What's changed?
   
   In the `Bulletin` list, if there is a deleted `Monitor`, the page and system 
will throw an exception. Although I can manually delete it, I expect the page 
to function normally
   
   ```
   2025-06-10 09:42:39.952 [http-nio-1157-exec-1] ERROR 
org.apache.hertzbeat.manager.support.GlobalExceptionHandler Line:252 - 
[monitor]-[unknown error happen]-Cannot invoke 
"org.apache.hertzbeat.common.entity.manager.Monitor.getName()" because 
"monitor" is null  
   java.lang.NullPointerException: Cannot invoke 
"org.apache.hertzbeat.common.entity.manager.Monitor.getName()" because 
"monitor" is null  
       at 
org.apache.hertzbeat.manager.service.impl.BulletinServiceImpl.buildBulletinMetricsData(BulletinServiceImpl.java:125)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)    at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)    at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:359)
 
   ```
   <img width="1511" alt="iShot_2025-06-10_09 43 35" 
src="https://github.com/user-attachments/assets/53a969cd-fee6-432a-b1b3-7910c32a5fe3";
 />
   
   Added a null check validation; if `Monitor` is null, subsequent logic will 
not be executed
   
   ## Checklist
   
   - [x]  I have read the [Contributing 
Guide](https://hertzbeat.apache.org/docs/community/code_style_and_quality_guide)
   - [x]  I have written the necessary doc or comment.
   - [x]  I have added the necessary unit tests and all cases have passed.
   
   ## Add or update API
   
   - [ ] I have added the necessary [e2e 
tests](https://github.com/apache/hertzbeat/tree/master/e2e) and all cases have 
passed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to