Fix double write NPE (#4886)

This commit is contained in:
杨翊 SionYang 2021-02-05 14:02:24 +08:00 committed by GitHub
parent 8dfaabdaf3
commit 3af5c03c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,6 +104,7 @@ public class ServiceChangeV1Task extends AbstractDelayTask {
serviceTask.getContent());
ServiceManager serviceManager = ApplicationUtils.getBean(ServiceManager.class);
Service service = serviceManager.getService(serviceTask.getNamespace(), serviceTask.getServiceName());
if (null != service) {
switch (serviceTask.getContent()) {
case METADATA:
dispatchMetadataTask(service, serviceTask.isEphemeral());
@ -114,6 +115,7 @@ public class ServiceChangeV1Task extends AbstractDelayTask {
default:
dispatchAllTask(service, serviceTask.isEphemeral());
}
}
return true;
}