We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ed56258 + a8c061c commit 759672dCopy full SHA for 759672d
lib/hub.js
@@ -79,7 +79,18 @@
79
// Ignore the ready message when viewing the hub directly
80
if (message.data === 'cross-storage:ready') return;
81
82
- request = JSON.parse(message.data);
+ // Check whether message.data is a valid json
83
+ try {
84
+ request = JSON.parse(message.data);
85
+ } catch (err) {
86
+ return;
87
+ }
88
+
89
+ // Check whether request.method is a string
90
+ if (!request || typeof request.method !== 'string') {
91
92
93
94
method = request.method.split('cross-storage:')[1];
95
96
if (!method) {
0 commit comments