Skip to content

Commit

Permalink
0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
danielstjules committed Jul 13, 2016
1 parent 91128b4 commit 5cbb62a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cross-storage",
"version": "0.8.1",
"version": "0.8.2",
"description": "Cross domain local storage",
"license": "Apache-2.0",
"authors": [
Expand Down
3 changes: 2 additions & 1 deletion dist/client.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* cross-storage - Cross domain local storage
*
* @version 0.8.1
* @version 0.8.2
* @link https://github.com/zendesk/cross-storage
* @author Daniel St. Jules <[email protected]>
* @copyright Zendesk
Expand Down Expand Up @@ -426,6 +426,7 @@
// Add request callback
client._requests[req.id] = function(err, result) {
clearTimeout(timeout);
delete client._requests[req.id];
if (err) return reject(new Error(err));
resolve(result);
};
Expand Down
4 changes: 2 additions & 2 deletions dist/client.min.js

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

22 changes: 19 additions & 3 deletions dist/hub.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* cross-storage - Cross domain local storage
*
* @version 0.8.1
* @version 0.8.2
* @link https://github.com/zendesk/cross-storage
* @author Daniel St. Jules <[email protected]>
* @copyright Zendesk
Expand Down Expand Up @@ -89,7 +89,18 @@
// Ignore the ready message when viewing the hub directly
if (message.data === 'cross-storage:ready') return;

request = JSON.parse(message.data);
// Check whether message.data is a valid json
try {
request = JSON.parse(message.data);
} catch (err) {
return;
}

// Check whether request.method is a string
if (!request || typeof request.method !== 'string') {
return;
}

method = request.method.split('cross-storage:')[1];

if (!method) {
Expand Down Expand Up @@ -187,7 +198,12 @@

for (i = 0; i < params.keys.length; i++) {
key = params.keys[i];
item = JSON.parse(storage.getItem(key));

try {
item = JSON.parse(storage.getItem(key));
} catch (e) {
item = null;
}

if (item === null) {
result.push(null);
Expand Down
4 changes: 2 additions & 2 deletions dist/hub.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cross-storage",
"version": "0.8.1",
"version": "0.8.2",
"description": "Cross domain local storage",
"keywords": [
"local",
Expand Down

0 comments on commit 5cbb62a

Please sign in to comment.