Skip to content

fix: add articleId validation to avoid potential NPE in detail API#124

Open
Yummyyh wants to merge 1 commit intoitwanger:mainfrom
Yummyyh:fix-id-validation
Open

fix: add articleId validation to avoid potential NPE in detail API#124
Yummyyh wants to merge 1 commit intoitwanger:mainfrom
Yummyyh:fix-id-validation

Conversation

@Yummyyh
Copy link

@Yummyyh Yummyyh commented Dec 8, 2025

This PR adds input validation for articleId in the detail API of ArticleRestController.

Changes:

  • Added validation to ensure articleId is non-null and positive.
  • Prevents potential NullPointerException when articleService returns null or invalid data.
  • Improves API stability and aligns with common input validation best practices.

Effect:
This enhancement avoids unexpected runtime errors and makes the API more robust when receiving invalid client parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant