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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java

Issue 10990074: Fix for NPE with StringLiteral in toString() (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java b/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
index 6bedf8ccf5d8ceaf3400a87ff878f81059d2fff2..0ad9d5858b34cc2402e094c50cc8e4ffbfb62a1e 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
@@ -816,6 +816,9 @@ public class DartToSourceVisitor extends ASTVisitor<Void> {
@Override
public Void visitStringLiteral(DartStringLiteral x) {
+ if (x.getValue() == null) {
+ return null;
+ }
p("\"");
// 'replaceAll' takes regular expressions as first argument and parses the second argument
// for captured groups. We must escape backslashes twice: once to escape them in the source
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698