Skip to content

Commit cc70c56

Browse files
committed
Only update stream filter when we have >0 URIs
The backend code in `h.streamer` assumes that the arguments to "one_of" are either a non-empty list or a single value. Passing an empty list causes the generation of a bogus query. So, don't update the stream filter until we have at least one URI to stream from. Fixes #2257.
1 parent 3920527 commit cc70c56

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

h/static/scripts/widget-controller.coffee

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ module.exports = class WidgetController
4040
loaded.push(f.uri)
4141
_loadAnnotationsFrom({uri: f.uri}, 0)
4242

43-
streamFilter.resetFilter().addClause('/uri', 'one_of', loaded)
44-
streamer.send({filter: streamFilter.getFilter()})
43+
if loaded.length > 0
44+
streamFilter.resetFilter().addClause('/uri', 'one_of', loaded)
45+
streamer.send({filter: streamFilter.getFilter()})
4546

4647
$scope.$watchCollection (-> crossframe.frames), loadAnnotations
4748

0 commit comments

Comments
 (0)