diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index fc2691268d6..84e1220f3ef 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -823,7 +823,6 @@ abstract class Component extends Widget { assert(_child == null); } - String _debugPreviousComponent; assert(() { _debugIsBuilding = true; _debugComponentBuildTree.add(this); @@ -1137,7 +1136,8 @@ abstract class RenderObjectWrapper extends Widget { Widget ancestor = current.parent; while (ancestor != null && ancestor is Component) ancestor = ancestor.parent; - current.debugValidateAncestor(ancestor); + if (ancestor != null) + current.debugValidateAncestor(ancestor); } return true; });