Permalink
Browse files

checking if _parser obj exists before accessing it.

  • Loading branch information...
1 parent c02d737 commit f476c7ac5e7853cfcc8f89004d9770e15745ffa1 @satyamshekhar satyamshekhar committed Apr 10, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/stream-parser.js
View
@@ -33,7 +33,8 @@ function XmppStreamParser() {
events.EventEmitter.apply(this);
this.__defineGetter__("getCurrentByteIndex", function () {
- return this._parser.getCurrentByteIndex();
+ if (!this._parser) return 0;
+ else return this._parser.getCurrentByteIndex();
});
this._start();

0 comments on commit f476c7a

Please sign in to comment.