Commit 04aa7e01 authored by Matthew Taylor's avatar Matthew Taylor

check for the null value in `get`

thanks @rschamp!
parent 794c3e2c
...@@ -79,9 +79,10 @@ var Jar = { ...@@ -79,9 +79,10 @@ var Jar = {
// Get a value from a signed object // Get a value from a signed object
Jar.get(cookieName, function (err, value) { Jar.get(cookieName, function (err, value) {
if (err) return callback(err); if (err) return callback(err);
if (typeof value === 'undefined') return callback(null, value);
Jar.unsign(value, function (err, contents) { Jar.unsign(value, function (err, contents) {
if (err) return callback(err); if (err) return callback(err);
if (typeof contents === 'undefined') return callback(null, contents);
try { try {
var data = JSON.parse(contents); var data = JSON.parse(contents);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment