From 6dc104401f5dde15c7c6cd2856dd960a28c14480 Mon Sep 17 00:00:00 2001 From: Dan MacTough Date: Fri, 1 Aug 2014 21:50:46 -0400 Subject: [PATCH] Fix type error: safer deep object properties to guard against malformed input. Resolves #4 --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index eaab871..99100d4 100644 --- a/main.js +++ b/main.js @@ -182,7 +182,7 @@ OpmlParser.prototype.handleCloseTag = function (el) { } if (n['#isoutline']) { // We have an outline node - if (!this.meta.title) { // We haven't yet parsed all the metadata + if (!this.meta.title && this.stack[1] && this.stack[1].head) { // We haven't yet parsed all the metadata utils.merge(this.meta, this.handleMeta(this.stack[1].head), true); } if (!baseurl && this.xmlbase && this.xmlbase.length) { // handleMeta was able to infer a baseurl without xml:base or options.feedurl