summaryrefslogtreecommitdiff
path: root/jni/node-inl.h
diff options
context:
space:
mode:
author Zim <zezeozue@google.com> 2020-01-07 18:11:27 +0000
committer Zim <zezeozue@google.com> 2020-01-08 10:58:55 +0000
commit87c7bf8abb3beeba2eefff1f19658d91712164bc (patch)
treecfef7b3a0420da51c6381cbc61939df9081197ed /jni/node-inl.h
parent23fa53ffdca84c26113a4c0bcd903e5711888fdb (diff)
Fix rename without changing parent nodes
Bug: 147274248 Test: Camera video recording works && atest fuse_node_test Change-Id: Ic191ca107047a35d2bbed51566d8c2c3ab5326af
Diffstat (limited to 'jni/node-inl.h')
-rw-r--r--jni/node-inl.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/jni/node-inl.h b/jni/node-inl.h
index 7986e99f7..5db14134e 100644
--- a/jni/node-inl.h
+++ b/jni/node-inl.h
@@ -143,12 +143,13 @@ class node {
}
void Rename(const std::string& name, node* new_parent) {
- CHECK(new_parent != parent_);
std::lock_guard<std::recursive_mutex> guard(*lock_);
name_ = name;
- RemoveFromParent();
- AddToParent(new_parent);
+ if (new_parent != parent_) {
+ RemoveFromParent();
+ AddToParent(new_parent);
+ }
}
const std::string& GetName() const {