From f33226fda62ae69e7ca5ff5d9b60d2523838b21a Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Mon, 1 Apr 2024 22:03:54 +0800 Subject: [PATCH] bugfix npe monitor jobid may be null (#1701) Signed-off-by: tomsun28 Co-authored-by: Logic --- .../hertzbeat/manager/scheduler/CollectorAndJobScheduler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/CollectorAndJobScheduler.java b/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/CollectorAndJobScheduler.java index 20559aa4e77..d6f82100371 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/CollectorAndJobScheduler.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/CollectorAndJobScheduler.java @@ -426,6 +426,9 @@ public long updateAsyncCollectJob(Job modifyJob, String collector) { @Override public void cancelAsyncCollectJob(Long jobId) { + if (jobId == null) { + return; + } for (ConsistentHash.Node node : consistentHash.getAllNodes().values()) { AssignJobs assignJobs = node.getAssignJobs(); if (assignJobs.getPinnedJobs().remove(jobId)