-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
If this attribute doesn't exist, it throws TypeError: Cannot read property 'objectMode' of undefined
It should check if _readableState exists before it checks for objectMode.
Below is the relevant function and the diff for the fix needed.
Hapi: 8.1.0
Node: 0.10.35
npm: 2.1.18
File: hapi/lib/response.js
internals.Response.prototype._streamify = function (source, next) {
if (source instanceof Stream) {
var stream = (source.socket || source);
if (stream._readableState.objectMode) {
return next(Boom.badImplementation('Cannot reply with stream in object mode'));
}
this._payload = source;
return next();
}
// other code
}
Diff
451c451
< if (stream._readableState.objectMode) {
---
> if (stream._readableState && stream._readableState.objectMode) {Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect