Closed andrewwakeling closed 9 years ago
This is a great catch. I think checking the key is the right way to go, but it's probably a little more robust to do something like this:
// setup
util.storageEventKeys = {};
util.forEach(util.keys, function(key) {
util.storageEventKeys[key] = 1;
});
// check
if (!event.key in util.storageEventKeys) {
// Not a crosstab event
return;
}
In onStorageEvent, it is optimistically parsing values as JSON and then assuming that the result is an object. This causes "eventValue" to be "null" and then "eventValue.id" to fail.
There are different ways of solving this, but I would have thought that crosstab should be checking the "key" property of all incoming StorageEvents and only processing ones that are relevant to crosstab.
Is using:
a possible fix?