Index: runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
diff --git a/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart b/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
index 77e1a724f7f84056aa895f76af2c7c440a108f52..daa65793dd4ab1b04ed50181469d456889636799 100644 |
--- a/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
+++ b/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
@@ -128,6 +128,14 @@ class CpuProfileVirtualTreeElement extends HtmlElement implements Renderable { |
} |
_tree = new VirtualTreeElement(create, update, _getChildren, |
items: tree.root.children, queue: _r.queue); |
+ if (tree.root.children.length == 0) { |
+ children = [ |
+ new DivElement() |
+ ..classes = ['tree-item'] |
+ ..children = [new HeadingElement.h1()..text = 'No Samples'] |
+ ]; |
+ return; |
+ } |
if (tree.root.children.length == 1) { |
cbernaschina
2017/07/31 21:19:13
Consider switch or else if
rmacnak
2017/08/01 19:58:58
Done.
|
_tree.expand(tree.root.children.first, autoExpandSingleChildNodes: true); |
} |