Skip to content
Prev Previous commit
Next Next commit
add extra check in stream_base.cc to be extra sure.
  • Loading branch information
robey committed Jul 24, 2020
commit 1440eaede05f3eb8cc64a1268d44db6ee718680e
3 changes: 2 additions & 1 deletion src/stream_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,8 @@ void CustomBufferJSListener::OnStreamRead(ssize_t nread, const uv_buf_t& buf) {
0,
StreamBase::SKIP_NREAD_CHECKS);
Local<Value> next_buf_v;
if (ret.ToLocal(&next_buf_v) && !next_buf_v->IsUndefined()) {
if (ret.ToLocal(&next_buf_v) && !next_buf_v->IsUndefined() &&
next_buf_v->IsArrayBufferView()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might this be what's causing problems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense... ok, i reverted that part.

buffer_.base = Buffer::Data(next_buf_v);
buffer_.len = Buffer::Length(next_buf_v);
}
Expand Down