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

@@ -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>