Index: lib/src/trace.dart |
diff --git a/lib/src/trace.dart b/lib/src/trace.dart |
index 2fce0c7c3d51aa64dc5f1a1eef025d4586b642fd..ce5ec50fe174c00f7916d21b494e547f1154b429 100644 |
--- a/lib/src/trace.dart |
+++ b/lib/src/trace.dart |
@@ -188,10 +188,12 @@ class Trace implements StackTrace { |
/// This also parses string representations of [Chain]s. They parse to the |
/// same trace that [Chain.toTrace] would return. |
Trace.parseFriendly(String trace) |
- : this(trace.trim().split("\n") |
- // Filter out asynchronous gaps from [Chain]s. |
- .where((line) => !line.startsWith('=====')) |
- .map((line) => new Frame.parseFriendly(line))); |
+ : this(trace.isEmpty |
+ ? [] |
+ : trace.trim().split("\n") |
+ // Filter out asynchronous gaps from [Chain]s. |
+ .where((line) => !line.startsWith('=====')) |
+ .map((line) => new Frame.parseFriendly(line))); |
/// Returns a new [Trace] comprised of [frames]. |
Trace(Iterable<Frame> frames) |