Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1912)

Unified Diff: sky/framework/fn.dart

Issue 1050153002: [Effen] fix _ensureDepth to work on root of tree, oops (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index 20a8b1cffac8f26e8ddf0d4eb3b09f6a79a03205..e01c34ddbc4f1a48cc2068b56ca8e8a524139e47 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -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;
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698