[BUG] ProxySelectorServiceImpl.update NPE on null discoveryRel / handler / discovery

Open Beginner friendly
#6,701 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
java
Domain
api, backend

Research direction

Start in shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/ProxySelectorServiceImpl.java at lines 347-394 and trace the createOrUpdate PUT /{id} path. Exercise updates with an omitted discovery object and with deleted or missing discovery bindings. Done means these cases return a clear 4xx error instead of throwing an NPE.

Written by the indexing model from the issue text.

Description

admin priority: medium type: bug
  • severity: Medium
  • files: shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/ProxySelectorServiceImpl.java:347-394
  • description: discoveryRelMapper.selectByProxySelectorId(proxySelectorDO.getId()) (353) is dereferenced at 354; discoveryHandlerMapper.selectById(discoveryHandlerId) (355) is mutated at 358; discoveryMapper.selectById(...) (364) is mutated at 366; proxySelectorAddDTO.getDiscovery() is dereferenced at 365-368 with no null check. Reached via createOrUpdate (PUT /{id}).
  • impact: Updating a proxy selector whose binding was deleted, or omitting discovery in the body, throws NPE rather than a 4xx.
  • suggested_fix: Null-check each lookup and return a clear error.
  • confidence: Medium
  • related_existing: #6517 is about omitted discoveryUpstreams; this is the omitted/missing discovery and missing rel/handler/discovery derefs, a separate path.

Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/06-medium-tiers.md.

Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
4d 11h
Merged PRs (30d)
85

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/shenyu

All issues in apache/shenyu

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.