fix(0.2.2): issue #49 (null pointer exception with optional @OneToOne relationships).

This commit is contained in:
marcus-bornman 2024-10-22 09:52:22 +02:00
parent 5209185ba2
commit daba2510db
3 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,7 @@
# Changelog
**0.2.2**
- Fixed #49
**0.2.1**
- Fixed #40
- Changed license from GPL v3 to MIT

View File

@ -11,7 +11,7 @@
</parent>
<groupId>tech.ailef</groupId>
<artifactId>snap-admin</artifactId>
<version>0.2.1</version>
<version>0.2.2</version>
<name>SnapAdmin</name>
<description>SnapAdmin is an auto-generated CRUD admin panel for Spring Boot/JPA apps</description>
<properties>

View File

@ -43,7 +43,7 @@
<th:block th:if="${field.isForeignKey()}">
<div th:replace="~{snapadmin/fragments/forms :: input_autocomplete(field=${field}, value=${
create ? (params != null ? params.getOrDefault(field.getName(), '') : '')
: (object != null ? object.traverse(field).getPrimaryKeyValue() : '' )
: (object != null && object.traverse(field) != null ? object.traverse(field).getPrimaryKeyValue() : '' )
})}">
</div>
</th:block>