Index: pkg/http/test/utils.dart |
diff --git a/pkg/http/test/utils.dart b/pkg/http/test/utils.dart |
index f9a73813ac83756dd26328b0174c8f67c34363e8..f93ca253c159254093f0cc7ce99c5c2f61bd9eaf 100644 |
--- a/pkg/http/test/utils.dart |
+++ b/pkg/http/test/utils.dart |
@@ -73,7 +73,8 @@ Future startServer() { |
var requestBody; |
if (requestBodyBytes.isEmpty) { |
requestBody = null; |
- } else if (request.headers.contentType.charset != null) { |
+ } else if (request.headers.contentType != null && |
+ request.headers.contentType.charset != null) { |
var encoding = requiredEncodingForCharset( |
request.headers.contentType.charset); |
requestBody = encoding.decode(requestBodyBytes); |