Skip to content

Commit b335252

Browse files
authored
fix: 优化树结构实体的保存 (#319)
1 parent 791084d commit b335252

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hsweb-commons/hsweb-commons-crud/src/main/java/org/hswebframework/web/crud/service/TreeSortServiceHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private void refactorPath() {
190190
if (old != null) {
191191
PK newParentId = data.getParentId();
192192
//父节点发生变化,更新所有子节点path
193-
if (!Objects.equals(parentId, newParentId)) {
193+
if (newParentId != null && !newParentId.equals(parentId)) {
194194
Consumer<E> childConsumer = child -> {
195195
//更新了父节点,但是同时也传入的对应的子节点
196196
E readyToUpdate = thisTime.get(child.getId());

0 commit comments

Comments
 (0)