Skip to content

Commit

Permalink
fix error catching on parsing null or undefined values
Browse files Browse the repository at this point in the history
  • Loading branch information
tflanagan committed Oct 13, 2015
1 parent 94da4d2 commit 2086760
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 6 additions & 5 deletions lib/xml2js.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/xml2js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -393,12 +393,12 @@ class exports.Parser extends events.EventEmitter
@reset()
cb err

str = str.toString()
if str.trim() is ''
@emit "end", null
return true

try
str = str.toString()
if str.trim() is ''
@emit "end", null
return true

str = bom.stripBOM str
if @options.async
@remaining = str
Expand Down

0 comments on commit 2086760

Please sign in to comment.