LearnBoost/knox — pull request #219 by pauliusuza (2014-02-07 16:54:39+00:00)
Title: Add null response handling

Occasionally our production app would crash due to "delete data.$" line, when "data" was null. We could not reproduce the reason why "data" would be null as no error was ever triggered. Added a simple check to throw an error in case "data" received is null.

Stack trace:

```
app[web.1]: An uncaughtException was found, the program will end. TypeError: Cannot convert null to object
app[web.1]: at /app/node_modules/knox/lib/client.js:836:18
app[web.1]: at Parser. (/app/node_modules/knox/node_modules/xml2js/lib/xml2js.js:255:20)
app[web.1]: at Parser.EventEmitter.emit (events.js:95:17)
app[web.1]: at Parser.exports.Parser.Parser.parseString (/app/node_modules/knox/node_modules/xml2js/lib/xml2js.js:270:14)
app[web.1]: at Parser.parseString (/app/node_modules/knox/node_modules/xml2js/lib/xml2js.js:6:61)
app[web.1]: at IncomingMessage. (/app/node_modules/knox/lib/client.js:833:10)
app[web.1]: at IncomingMessage.EventEmitter.emit (events.js:117:20)
app[web.1]: at _stream_readable.js:920:16
app[web.1]: at process._tickCallback (node.js:415:13)
```