You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (subnodeIndex > subnodesCount || subnodeIndex < 0) {
2120
2119
ASDisplayNodeFailAssert(@"Cannot insert a subnode at index %ld. Count is %ld", (long)subnodeIndex, (long)subnodesCount);
2121
2120
return;
2122
2121
}
2123
-
2122
+
2123
+
// Check if subnode is already a in _subnodes. If so make sure the subnodeIndex will not be out of bounds once we call [subnode removeFromSupernode]
2124
+
if (subnode.supernode == self && subnodeIndex >= subnodesCount) {
2125
+
ASDisplayNodeFailAssert(@"node %@ is already a subnode of %@. index %ld will be out of bounds once we call [subnode removeFromSupernode]. This can be caused by using automaticallyManagesSubnodes while also calling addSubnode explicitly.", subnode, self, subnodeIndex);
2126
+
return;
2127
+
}
2128
+
2124
2129
// Disable appearance methods during move between supernodes, but make sure we restore their state after we do our thing
0 commit comments