Skip to content

Commit

Permalink
fix: handle null or undefined _data (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarantoj-intrepid authored Dec 14, 2021
1 parent fadb926 commit 5d762aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/runtime/fetch/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function createCall (handle: Handle) {

return handle(req, res).then(() => {
const r = {
body: res._data.toString(),
body: (res._data as any)?.toString() ?? '',
headers: res._headers,
status: res.statusCode,
statusText: res.statusMessage
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/node/stream/writable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Writable extends EventEmitter implements stream.Writable {

destroyed: boolean = false

_data: any
_data: unknown
_encoding: BufferEncoding = 'utf-8'

constructor (_opts?: stream.WritableOptions) {
Expand Down

0 comments on commit 5d762aa

Please sign in to comment.