Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save russellhaering/565032 to your computer and use it in GitHub Desktop.
Save russellhaering/565032 to your computer and use it in GitHub Desktop.
From a577a6fc0a83adba1b5ba5de28a1e656ef68a570 Mon Sep 17 00:00:00 2001
From: Russell Haering <russellhaering@gmail.com>
Date: Sat, 4 Sep 2010 01:48:40 -0700
Subject: [PATCH] Prevent ReadStream.resume from breaking if the file isn't yet open.
---
lib/fs.js | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/lib/fs.js b/lib/fs.js
index 7c8b38c..06df80f 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -793,7 +793,9 @@ ReadStream.prototype.resume = function() {
this.buffer = null;
}
- this._read();
+ if (this.fd) {
+ this._read();
+ }
};
--
1.7.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment