summaryrefslogtreecommitdiff
path: root/net/textproto.ts
diff options
context:
space:
mode:
Diffstat (limited to 'net/textproto.ts')
-rw-r--r--net/textproto.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/textproto.ts b/net/textproto.ts
index 342d74b33..832299e1c 100644
--- a/net/textproto.ts
+++ b/net/textproto.ts
@@ -118,11 +118,12 @@ export class TextProtoReader {
async readLineSlice(): Promise<[Uint8Array, BufState]> {
// this.closeDot();
- let line: null | Uint8Array;
+ let line: Uint8Array;
while (true) {
let [l, more, err] = await this.r.readLine();
if (err != null) {
- return [null, err];
+ // Go's len(typed nil) works fine, but not in JS
+ return [new Uint8Array(0), err];
}
// Avoid the copy if the first call produced a full line.
if (line == null && !more) {