From 77b0c1dab0567d64b261ceec34f919ffa1bf2590 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Wed, 19 Jul 2017 12:57:13 -0700 Subject: [PATCH] Don't pass "null" to debugPrint. (#11265) debugDumpLayerTree in particular was passing null in profile mode since debugLayer isn't available in profile mode. --- packages/flutter/lib/src/rendering/binding.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/rendering/binding.dart b/packages/flutter/lib/src/rendering/binding.dart index 6faf2d72f5..655507669d 100644 --- a/packages/flutter/lib/src/rendering/binding.dart +++ b/packages/flutter/lib/src/rendering/binding.dart @@ -309,12 +309,12 @@ abstract class RendererBinding extends BindingBase with SchedulerBinding, Servic /// Prints a textual representation of the entire render tree. void debugDumpRenderTree() { - debugPrint(RendererBinding.instance?.renderView?.toStringDeep()); + debugPrint(RendererBinding.instance?.renderView?.toStringDeep() ?? 'Render tree unavailable.'); } /// Prints a textual representation of the entire layer tree. void debugDumpLayerTree() { - debugPrint(RendererBinding.instance?.renderView?.debugLayer?.toStringDeep()); + debugPrint(RendererBinding.instance?.renderView?.debugLayer?.toStringDeep() ?? 'Layer tree unavailable.'); } /// Prints a textual representation of the entire semantics tree.