issue warning when raise_event_handler is called with query_uuid being undefined
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 15 Nov 2013 09:49:29 +0000 (10:49 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 15 Nov 2013 09:49:29 +0000 (10:49 +0100)
manifold/static/js/manifold.js

index 877b69c..c6e9d41 100644 (file)
@@ -769,7 +769,15 @@ var manifold = {
     raise_event_handler: function(type, query_uuid, event_type, value) {
         if ((type != 'query') && (type != 'record'))
             throw 'Incorrect type for manifold.raise_event()';
+       // xxx we observe quite a lot of incoming calls with an undefined query_uuid
+       // this should be fixed upstream
+       if (query_uuid === undefined) {
+           messages.warning("undefined query in raise_event_handler");
+           return;
+       }
 
+       // notify the change to objects that either listen to this channel specifically,
+       // or to the wildcard channel
         var channels = [ manifold.get_channel(type, query_uuid), manifold.get_channel(type, '*') ];
 
         $.each(channels, function(i, channel) {