[Fix] always clone templates

This commit is contained in:
Robert von Burg 2023-07-20 14:59:55 +02:00
parent f572973309
commit 36b8a8b664
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ public abstract class TransientElementMap<T extends StrolchRootElement> implemen
if (t == null)
return null;
if (tx.isReadOnly())
if (tx.isReadOnly() && !type.equals(TEMPLATE))
return t;
@SuppressWarnings("unchecked")
@ -187,7 +187,7 @@ public abstract class TransientElementMap<T extends StrolchRootElement> implemen
if (byType == null)
return new ArrayList<>(0);
if (tx.isReadOnly())
if (tx.isReadOnly() && !type.equals(TEMPLATE))
return new ArrayList<>(byType.values());
return byType.values().stream().map(t -> {