Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[core] fix crash when vnode is null (#1918)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhan-he authored and YorkShen committed Dec 17, 2018
1 parent 183a9c3 commit cb44e2f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ void UpdateChildren(const string& page_id, VNode* old_node, VNode* new_node) {
} else if (old_end_node == nullptr) {
old_end_node = GetOrNull(old_children, --old_end);

} else if (new_start_node == nullptr) {
new_start_node = GetOrNull(new_children, ++new_start);
} else if (new_end_node == nullptr) {
new_end_node = GetOrNull(new_children, --new_end);
} else if (SameNode(old_start_node, new_start_node)) {
PatchVNode(page_id, old_start_node, new_start_node);
old_start_node = GetOrNull(old_children, ++old_start);
Expand Down

0 comments on commit cb44e2f

Please sign in to comment.