@@ -1233,6 +1233,9 @@ function nReadingNextTick(self) {
|
1233 | 1233 | // If the user uses them, then switch into old mode. |
1234 | 1234 | Readable.prototype.resume = function() { |
1235 | 1235 | const state = this._readableState; |
| 1236 | +if ((state[kState] & kDestroyed) !== 0) { |
| 1237 | +return this; |
| 1238 | +} |
1236 | 1239 | if ((state[kState] & kFlowing) === 0) { |
1237 | 1240 | debug('resume'); |
1238 | 1241 | // We flow only if there is no one listening |
@@ -1273,6 +1276,9 @@ function resume_(stream, state) {
|
1273 | 1276 | |
1274 | 1277 | Readable.prototype.pause = function() { |
1275 | 1278 | const state = this._readableState; |
| 1279 | +if ((state[kState] & kDestroyed) !== 0) { |
| 1280 | +return this; |
| 1281 | +} |
1276 | 1282 | debug('call pause'); |
1277 | 1283 | if ((state[kState] & (kHasFlowing | kFlowing)) !== kHasFlowing) { |
1278 | 1284 | debug('pause'); |
|