spring-projects / spring-data-rest

Simplifies building hypermedia-driven REST web services on top of Spring Data repositories
https://spring.io/projects/spring-data-rest
Apache License 2.0
913 stars 561 forks source link

Prevent NPE from occurring #2362

Closed birariro closed 6 days ago

birariro commented 7 months ago

Hi, I think NotNull Message looks better than NPE.

mp911de commented 7 months ago

How did you encounter a null pointer at ValidationErrors? Do you have a stack trace handy?

birariro commented 7 months ago

There is no reason for an NPE to occur in ValidationErrors. But if you look at the existing code Assert.notNull(source, "Entity must not be null");

Since there is a logic to check null, I thought we considered the possibility of it occurring.