Skip to content

Commit b720bd9

Browse files
committed
fix(repository): prevent NPE by reversing equals check order in AbstractRepository
- AbstractRepository: fix potential NullPointerException in createMap by calling equals on constant instead of possibly null value to ensure safe comparison when filtering empty properties
1 parent 587f56a commit b720bd9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/io/github/trae/database/repository/AbstractRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private LinkedHashMap<String, Object> toDataMap(final Domain domain, final List<
330330
return UtilJava.createMap(new LinkedHashMap<>(), map -> {
331331
for (final Property property : propertyList) {
332332
Object value = domain.getValueByProperty(property);
333-
if (value.equals(Constants.EMPTY_PROPERTY)) {
333+
if (Constants.EMPTY_PROPERTY.equals(value)) {
334334
continue;
335335
}
336336

0 commit comments

Comments
 (0)