auth0/node-jsonwebtoken — pull request #16 by tdantas (2014-08-03 12:06:23+00:00)
Title: decode invalid jwt token returns null

hey guys,
I was trying to decode a jwt token that comes from web ( api ) and works really nice but when I sent an invalid token the decode function blows up.

jws module returns **null** with invalid token
```js
$ node
> var jws = require('jws')
> jws.decode('invalid');
null
```
and the [decode function](https://github.com/auth0/node-jsonwebtoken/blob/master/index.js#L4) blows up trying to fetch the payload from null.

```js
$ node

> jwt = require('./');
{ decode: [Function],
sign: [Function],
verify: [Function] }

> jwt.decode('whatever invalid token');
TypeError: Cannot read property 'payload' of null
at Object.module.exports.decode (/Users/tdantas/Code/PR/node-jsonwebtoken/index.js:4:25)
at repl:1:5
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface. (repl.js:239:12)
at Interface.emit (events.js:95:17)
at Interface._onLine (readline.js:202:10)
at Interface._line (readline.js:531:8)
at Interface._ttyWrite (readline.js:760:14)
```
cya