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..21c4388bc43674df1d842e5c3f4d92a2d8625f61 100644 |
--- a/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
+++ b/runtime/observatory/lib/src/elements/cpu_profile/virtual_tree.dart |
@@ -128,7 +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 == 1) { |
+ if (tree.root.children.length == 0) { |
+ children = [ |
+ new DivElement() |
+ ..classes = ['tree-item'] |
+ ..children = [new HeadingElement.h1()..text = 'No Samples'] |
+ ]; |
+ return; |
+ } else if (tree.root.children.length == 1) { |
_tree.expand(tree.root.children.first, autoExpandSingleChildNodes: true); |
} |
children = [_tree]; |