Merge pull request #1279 from CEOsys/master

copy Element children to prevent value modification when validating
This commit is contained in:
Grahame Grieve 2023-05-28 15:48:14 +03:00 committed by GitHub
commit 6ddb7cdb28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1368,7 +1368,9 @@ public class Element extends Base {
dest.value = value;
if (children != null) {
dest.children = new ArrayList<>();
dest.children.addAll(children);
for (Element child : children) {
dest.children.add((Element) child.copy());
}
} else {
dest.children = null;
}