Index: pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart |
diff --git a/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart b/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart |
index 3b90b51e4c9425947016d09baabae300dde31d56..c0f65fb5487faf2bb4e0c984bea78e11dd6d08e6 100644 |
--- a/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart |
+++ b/pkg/analyzer_plugin/lib/src/channel/isolate_channel.dart |
@@ -280,10 +280,12 @@ abstract class ServerIsolateChannel implements ServerCommunicationChannel { |
@override |
void sendRequest(Request request) { |
- Map<String, Object> json = request.toJson(); |
- String encodedRequest = JSON.encode(json); |
- instrumentationService.logPluginRequest(pluginId, encodedRequest); |
- _sendPort.send(json); |
+ if (_sendPort != null) { |
+ Map<String, Object> json = request.toJson(); |
+ String encodedRequest = JSON.encode(json); |
+ instrumentationService.logPluginRequest(pluginId, encodedRequest); |
+ _sendPort.send(json); |
+ } |
} |
/** |