We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1218b49 commit 43848d7Copy full SHA for 43848d7
1 file changed
src/communication/handlers.js
@@ -6,7 +6,7 @@ filepicker.extend('handlers', function(){
6
var storage = {};
7
8
var attachHandler = function(id, handler){
9
- if (storage.hasOwnProperty(id)){
+ if (storage.hasOwnProperty(id)){
10
storage[id].push(handler);
11
} else {
12
storage[id] = [handler];
@@ -36,8 +36,11 @@ filepicker.extend('handlers', function(){
36
};
37
38
var run = function(data){
39
+ if (data == null || data.id == null || data.type == null) {
40
+ return false;
41
+ }
42
var callerId = data.id;
- if (storage.hasOwnProperty(callerId)){
43
+ if (storage.hasOwnProperty(callerId)){
44
//have to grab first in case someone removes mid-go
45
var handlers = storage[callerId];
46
for (var i = 0; i < handlers.length; i++) {
0 commit comments