mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Effen] fix _ensureDepth to work on root of tree, oops
R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1050153002
This commit is contained in:
parent
6ff2cfbe82
commit
ee63773cd1
@ -94,8 +94,12 @@ abstract class UINode {
|
||||
int _nodeDepth;
|
||||
void _ensureDepth() {
|
||||
if (_nodeDepth == null) {
|
||||
_parent.ensureDepth();
|
||||
_nodeDepth = _parent._nodeDepth + 1;
|
||||
if (_parent != null) {
|
||||
_parent.ensureDepth();
|
||||
_nodeDepth = _parent._nodeDepth + 1;
|
||||
} else {
|
||||
_nodeDepth = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user