maxnowack/node-podcast — pull request #2 by SJAnderson (2014-09-27 00:15:45+00:00)
Title: Update XML so it _elem is no longer undefined

When I went to use your plugin on my server it failed because XML was outdated. The error:
```
TypeError: Cannot read property '_elem' of undefined
at resolve (/Users/SJAnderson/dev/SJAnderson/node-podcast/node_modules/xml/lib/xml.js:143:19)
at /Users/SJAnderson/dev/SJAnderson/node-podcast/node_modules/xml/lib/xml.js:189:42
at Array.forEach (native)
at resolve (/Users/SJAnderson/dev/SJAnderson/node-podcast/node_modules/xml/lib/xml.js:182:24)
at /Users/SJAnderson/dev/SJAnderson/node-podcast/node_modules/xml/lib/xml.js:189:42
at Array.forEach (native)
at resolve (/Users/SJAnderson/dev/SJAnderson/node-podcast/node_modules/xml/lib/xml.js:182:24)
at add (/Users/SJAnderson/dev/SJAnderson/node-podcast/node_modules/xml/lib/xml.js:47:24)
at xml (/Users/SJAnderson/dev/SJAnderson/node-podcast/node_modules/xml/lib/xml.js:88:9)
at Podcast.xml (/Users/SJAnderson/dev/SJAnderson/node-podcast/lib/podcast.js:67:19)
at Object. (/Users/SJAnderson/dev/SJAnderson/node-podcast/testing.coffee:56:18)
at Object. (/Users/SJAnderson/dev/SJAnderson/node-podcast/testing.coffee:1:1)
at Module._compile (module.js:456:26)
```

Line 143 of xml.js@~0.0.4, your version
```js
if (values._elem) {
values._elem.name = name;
values._elem.icount = indent_count;
values._elem.indent = indent;
values._elem.indents = indent_spaces;
values._elem.interrupt = values;
return values._elem;
}
```

The latest version of xml addresses this problem by adding the following conditional
`if (values && values._elem) {`

When I update XML to the latest version, 1.0.0, it now works.

```html

<![CDATA[title]]>

description
http://example.com

http://example.com/icon.png

title

http://example.com

Podcast for Node
Sat, 27 Sep 2014 00:14:02 GMT

Dylan Greene
Sun, 20 May 2012 04:00:00 GMT
2013 Dylan Greene
en
Dylan Greene
Dylan Greene
http://example.com/rss/docs.html
60
Max Nowack
I am a sub title
I am a summary

No

Max Nowack
max@unsou.de

Category 1
Category 2
Category 3

<![CDATA[item title]]>

use this for the content. It can include html.
http://example.com/article4?this&that
1123
Guest Author
Sun, 27 May 2012 07:00:00 GMT
Max Nowack
No
I am a sub title
I am a summary
12345
podcast
33.417974
-111.933231

```