Crash using parseString #51

Closed
glynnbird opened this Issue Mar 15, 2013 · 1 comment

Projects

None yet

2 participants

@glynnbird

This works:

    var feedparser = require('feedparser');
    feedparser.parseUrl("http://code.google.com/feeds/p/trophyim/updates/basic", function(err,data) {
               console.log(err,data);
    });

this doesn't:

  var request = require('request');
  var feedparser = require('feedparser');

  var reqObj = {'uri': "http://code.google.com/feeds/p/trophyim/updates/basic"};

  request(reqObj, function (err, response, body){
     feedparser.parseString(body, function(err,data) {
             console.log(err,data);
     });
    });

it crashes with the error:

TypeError: Cannot use 'in' operator to search for '#' in false
    at FeedParser.handleText (/Users/gbird/projects/reader/node_modules/feedparser/main.js:340:28)
    at SAXStream.EventEmitter.emit (events.js:95:17)
    at Object.me._parser.(anonymous function) [as ontext] (/Users/gbird/projects/reader/node_modules/sax/lib/sax.js:220:15)
    at emit (/Users/gbird/projects/reader/node_modules/sax/lib/sax.js:589:33)
    at closeText (/Users/gbird/projects/reader/node_modules/sax/lib/sax.js:599:24)
    at end (/Users/gbird/projects/reader/node_modules/sax/lib/sax.js:625:3)
    at Object.SAXParser.end (/Users/gbird/projects/reader/node_modules/sax/lib/sax.js:137:24)
    at SAXStream.end (/Users/gbird/projects/reader/node_modules/sax/lib/sax.js:209:16)
    at Function.FeedParser.parseString (/Users/gbird/projects/reader/node_modules/feedparser/main.js:1032:6)
    at Request._callback (/Users/gbird/projects/reader/test.js:18:17)
@danmactough
Owner

Thanks, @glynnbird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment