Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(778)

Unified Diff: lib/src/chain.dart

Issue 1492323004: Fix a crash in Chain.terse and Chain.foldFrames. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/chain.dart
diff --git a/lib/src/chain.dart b/lib/src/chain.dart
index 2e07d4bb9c776b81e50647d60a9e449cdbd89ad0..2e63ef02c6ffb3652a27d8bacb029f3cf2598755 100644
--- a/lib/src/chain.dart
+++ b/lib/src/chain.dart
@@ -37,7 +37,6 @@ typedef void ChainHandler(error, Chain chain);
/// "$stackChain");
/// });
class Chain implements StackTrace {
-
/// The stack traces that make up this chain.
///
/// Like the frames in a stack trace, the traces are ordered from most local
@@ -155,6 +154,7 @@ class Chain implements StackTrace {
var nonEmptyTraces = foldedTraces.where((trace) {
// Ignore traces that contain only folded frames.
if (trace.frames.length > 1) return true;
+ if (trace.frames.isEmpty) return false;
// In terse mode, the trace may have removed an outer folded frame,
// leaving a single non-folded frame. We can detect a folded frame because
« no previous file with comments | « CHANGELOG.md ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698