-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Integration] Cat integration CatRegistryFactoryWrapper NullPointerException #2343
Comments
Line 37 in 60693f7
经过Debug 构造函数这里接收了空值,难以复现,但2024年了,还是遇到了
|
临时修复建议 @Override
public Registry getRegistry(URL url) {
Registry registry = registryFactory.getRegistry(url);
if (registry == null) {
logger.info("registry is null url " + url);
return registry;
}
return new RegistryWrapper(registry);
} 依据:可以看到 Dubbo 的 ListenerRegistryWrapper 进行了registry != null 判断,并且从该PR开始,getRegistry根据check进行判断,check=false的时候,registry是可以等于null的 public class ListenerRegistryWrapper implements Registry {
@Override
public void register(URL url) {
try {
if (registry != null) {
registry.register(url);
}
} finally {
if (!UrlUtils.isConsumer(url)) {
listenerEvent(serviceListener -> serviceListener.onRegister(url, registry));
}
}
}
} 依据2:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
CatRegistryFactoryWrapper has a potential NPE bug
To Reproduce
Expected behavior
normal startup
Versions
Dubbo 3.1.6
Spring 5.2.8.RELEASE
Exception
The text was updated successfully, but these errors were encountered: