Index: pkg/analysis_server/lib/src/protocol.dart |
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart |
index d446162422357a4904b7a058f05df728f58afc4f..5827d47cd5b1c434e64a3e58ed9525046796b92e 100644 |
--- a/pkg/analysis_server/lib/src/protocol.dart |
+++ b/pkg/analysis_server/lib/src/protocol.dart |
@@ -265,7 +265,11 @@ class Response { |
Map<String, Object> toJson() { |
Map jsonObject = new Map(); |
jsonObject[ID] = id; |
- jsonObject[ERROR] = error.toJson(); |
+ if (error == null) { |
+ jsonObject[ERROR] = null; |
+ } else { |
+ jsonObject[ERROR] = error.toJson(); |
+ } |
if (!result.isEmpty) { |
jsonObject[RESULT] = result; |
} |