Skip to content
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

[2.0.0] NPE when get subscribers by NamingSubscriberServiceLocalImpl #5001

Closed
pixystone opened this issue Mar 4, 2021 · 0 comments
Closed
Assignees
Labels
kind/bug Category issues or prs related to bug. version/2.x
Milestone

Comments

@pixystone
Copy link
Contributor

Describe the bug

NamingSubscriberServiceLocalImpl

@Override
    public Collection<Subscriber> getSubscribers(String namespaceId, String serviceName) {
        Collection<Subscriber> result = new HashSet<>();
        result.addAll(namingSubscriberServiceV1.getSubscribers(namespaceId, serviceName));
        result.addAll(namingSubscriberServiceV2.getSubscribers(namespaceId, serviceName));
        return result;
    }

NamingSubscriberServiceV1Impl

@Override
    public Collection<Subscriber> getSubscribers(String namespaceId, String serviceName) {
        String serviceKey = UtilsAndCommons.assembleFullServiceName(namespaceId, serviceName);
        ConcurrentMap<String, PushClient> clientConcurrentMap = clientMap.get(serviceKey);
      
        if (Objects.isNull(clientConcurrentMap)) {
            return null;             // <---
        }
        ...
    }

Expected behavior

returns an empty list

Acutally behavior

return null

Desktop (please complete the following information):

  • Version [nacos-server 2.0.0-BETA]
  • Module [naming]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Category issues or prs related to bug. version/2.x
Projects
None yet
Development

No branches or pull requests

2 participants