Index: pkg/analyzer/lib/src/dart/analysis/driver.dart |
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart |
index d1497604c790bcda30aa9250479d31fca7b1157b..91a5186bf34557998449f25a9c1c908e1c75b624 100644 |
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart |
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart |
@@ -1483,11 +1483,13 @@ class PerformanceLog { |
} |
/** |
- * Write a new line into the log |
+ * Write a new line into the log. |
*/ |
void writeln(String msg) { |
- String indent = '\t' * _level; |
- sink.writeln('$indent$msg'); |
+ if (sink != null) { |
+ String indent = '\t' * _level; |
+ sink.writeln('$indent$msg'); |
+ } |
} |
} |