Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
[fs] Check for closed handle in StreamWrap::Writev
Browse files Browse the repository at this point in the history
  • Loading branch information
dnakamura committed Jun 5, 2015
1 parent f9d783a commit eed9392
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/stream_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,14 @@ void StreamWrap::Writev(const FunctionCallbackInfo<Value>& args) {

StreamWrap* wrap = Unwrap<StreamWrap>(args.Holder());

if ( NULL == wrap) {
// wrap is set to NULL when the handle for the request
// is closed. Since the handle is no longer valid return
// UV_EBADF to indicate this
args.GetReturnValue().Set(UV_EBADF);
return;
}

assert(args[0]->IsObject());
assert(args[1]->IsArray());

Expand Down

0 comments on commit eed9392

Please sign in to comment.