fold ==null
Liangwenb opened this issue · 2 comments
Invalid server response:
{"error":{"message":"NoSuchMethodError: The method 'fold' was called on null.\nReceiver: null\nTried calling: fold(Instance of '_CopyingBytesBuilder', Closure: (BytesBuilder, List) => BytesBuilder)"}}
try {
var email = await _getUploaderEmail(req);
var mediaType = MediaType.parse(req.headers['content-type']);
var boundary = mediaType.parameters['boundary'];
MimeMultipart fileData;
await for (MimeMultipart part
in req.read().transform(MimeMultipartTransformer(boundary))) {
if (fileData != null) continue;
fileData = part;
}
ERR : Invalid server response:
| {"error":{"message":"NoSuchMethodError: The method 'fold' was called on null.\nReceiver: null\nTried calling: fold(Instance of '_CopyingBytesBuilder', Closure: (BytesBuilder, List) => BytesBuilder)"}}
FINE: Exception type: ApplicationException
FINE: package:pub/src/utils.dart 506:5 fail
| package:pub/src/http.dart 329:5 invalidServerResponse
| package:pub/src/http.dart 292:5 handleJsonSuccess
| package:pub/src/command/lish.dart 101:9 LishCommand._publish.
| ===== asynchronous gap ===========================
| dart:async Future.catchError
| package:pub/src/utils.dart 113:52 captureErrors.wrappedCallback
| package:stack_trace Chain.capture
| package:pub/src/utils.dart 126:11 captureErrors
| package:pub/src/command_runner.dart 182:13 PubCommandRunner.runCommand
Same as pub_server
Hi, could you try the latest version v2.0.0, and check if this issue still exists?