Skip to content

Commit c641931

Browse files
committed
fix(kotlin): InMemoryRepository manage relationships adds .? nullsafety check
1 parent ffd0e3d commit c641931

File tree

1 file changed

+1
-1
lines changed
  • plugins/customizations/kotlin-backend-application/src/main/resources/io/zenwave360/sdk/plugins/kotlin/BackendApplicationDefaultGenerator/src/test/kotlin/infrastructure/jpa/imperative/inmemory

1 file changed

+1
-1
lines changed

plugins/customizations/kotlin-backend-application/src/main/resources/io/zenwave360/sdk/plugins/kotlin/BackendApplicationDefaultGenerator/src/test/kotlin/infrastructure/jpa/imperative/inmemory/EntityRepositoryInMemory.kt.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class {{entity.className}}RepositoryInMemory : InMemoryJpaRepository<{{entity.cl
2626
{{~#if (endsWith relationship.type 'ToMany')}}
2727
entity.{{relationship.fieldName}}.forEach { it.id = it.id ?: entity.id }
2828
{{~else if (endsWith relationship.type 'ToOne')}}
29-
entity.{{relationship.fieldName}}.id = entity.{{relationship.fieldName}}.id ?: entity.id
29+
entity.{{relationship.fieldName}}?.id = entity.{{relationship.fieldName}}.id ?: entity.id
3030
{{~/if}}
3131
{{~/each}}
3232
return entity;

0 commit comments

Comments
 (0)