Skip to content

[Fix] fix custom monitoring bulletin NullPointerException #3448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 13, 2025

Conversation

Duansg
Copy link
Contributor

@Duansg Duansg commented Jun 10, 2025

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) 
iShot_2025-06-10_09 43 35

Added a null check validation; if Monitor is null, subsequent logic will not be executed

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

@Duansg Duansg changed the title Fix custom monitoring bulletin NullPointerException [Fix] fix custom monitoring bulletin NullPointerException Jun 10, 2025
Copy link
Contributor

@LiuTianyou LiuTianyou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!👍🏻

@LiuTianyou LiuTianyou merged commit d5d0145 into apache:master Jun 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants