Skip to content
This repository
Browse code

checking if _parser obj exists before accessing it.

  • Loading branch information...
commit f476c7ac5e7853cfcc8f89004d9770e15745ffa1 1 parent c02d737
satyamshekhar authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  src/stream-parser.js
3  src/stream-parser.js
@@ -33,7 +33,8 @@ function XmppStreamParser() {
33 33
     events.EventEmitter.apply(this);
34 34
 
35 35
     this.__defineGetter__("getCurrentByteIndex", function () {
36  
-        return this._parser.getCurrentByteIndex();
  36
+        if (!this._parser) return 0;
  37
+        else return this._parser.getCurrentByteIndex();
37 38
     });
38 39
 
39 40
     this._start();

0 notes on commit f476c7a

Please sign in to comment.
Something went wrong with that request. Please try again.