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

Unified Diff: pkg/kernel/lib/text/ast_to_text.dart

Issue 2617973002: Print <<NULL>> instead of crashing. (Closed)
Patch Set: Created 3 years, 11 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/text/ast_to_text.dart
diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart
index 67152054b4815e247d9c792224d8dec5dd8df6d7..29602e609dda9f0702d8e27d0b5aab6f283a0ac8 100644
--- a/pkg/kernel/lib/text/ast_to_text.dart
+++ b/pkg/kernel/lib/text/ast_to_text.dart
@@ -393,7 +393,11 @@ class Printer extends Visitor<Null> {
}
void writeNode(Node node) {
- node.accept(this);
+ if (node == null) {
+ writeSymbol("<<NULL>>");
ahe 2017/01/06 15:32:31 Any suggestions for a better string to use here?
asgerf 2017/01/06 15:33:36 <Null> is consistent with what we write in default
ahe 2017/01/06 15:37:44 Done.
+ } else {
+ node.accept(this);
+ }
}
void writeOptionalNode(Node node) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698