Permalink
Browse files

Merge branch 'release/0.4.6'

  • Loading branch information...
2 parents 7be50da + f8604ae commit 199200bd88c46f694622f45432a376c9454a6194 @cvee cvee committed Apr 19, 2012
Showing with 13 additions and 3 deletions.
  1. +6 −0 doc/release-notes.md
  2. +6 −2 lib/StreamClient.js
  3. +1 −1 package.json
View
6 doc/release-notes.md
@@ -1,5 +1,11 @@
# node-twitter Release Notes
+## Version 0.4.6
+
+*Published on 2012-04-19*
+
+* [FIXED] [Issue #6 StreamClient crashes on response data contains with terminator but no stream object.](https://github.com/istrategylabs/node-twitter/issues/6).
+
## Version 0.4.5
*Published on 2012-04-13*
View
8 lib/StreamClient.js
@@ -226,6 +226,10 @@ StreamClient.prototype._requestDidReceiveData = function(aRequest, aData)
var jsonString = connection['data'].slice(0, index);
connection['data'] = connection['data'].slice(index + Constants.StreamApiObjectTerminator.length);
+ // If jsonString has a length of zero continue without emitting any
+ // events.
+ if (jsonString.length === 0) continue;
+
var object = undefined;
try
{
@@ -239,8 +243,8 @@ StreamClient.prototype._requestDidReceiveData = function(aRequest, aData)
this.emit('error', e);
}
- // If object is undefined return without emitting any events.
- if (object === undefined) return;
+ // If object is undefined continue without emitting any events.
+ if (object === undefined) continue;
if (object.delete !== undefined)
{
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "node-twitter",
- "version": "0.4.5",
+ "version": "0.4.6",
"description": "A node.js module for interacting with the Twitter API.",
"keywords": ["twitter"],
"bugs": {

0 comments on commit 199200b

Please sign in to comment.