spring-projects / spring-projects/spring-data-rest

NullPointerException when mapping is null (such as when used with spring data cassandra repositories)

Open
#2,081 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Jan 4, 2022.

status: feedback-provided
Dominant language
Java
Stars
958
Forks
568
PR merge metrics
No merged PRs in 30d

Description

"mapping" can be null here, causing the .isExported() to throw a NPE.

https://github.com/spring-projects/spring-data-rest/blob/a40aec5debf496b8e29d66a720ad27989b04f2bd/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileController.java#L94-L111

I thought i was using the strategy to only include annotated repositories and that would not happen (spring.data.rest.detection-strategy=annotated). I did not intend for this repository to actually be included in the profile. but it got to this point in the code and it null pointer'ed.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.