Skip to content

Commit

Permalink
Fix "Cannot read property 'content' of null" error
Browse files Browse the repository at this point in the history
This happened when events events were being sent back and forth from Python to JS rapidly.
In particular, when a plot was updated in response to continuous viewport changes.
  • Loading branch information
jonmmease committed Aug 6, 2019
1 parent f8e5894 commit 327f5b5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion panel/io/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@
if (!window.PyViz) {{
return;
}}
var events = [];
var receiver = window.PyViz.receivers['{plot_id}'];
var events = receiver ? receiver._partial.content.events : [];
if (receiver &&
receiver._partial &&
receiver._partial.content &&
receiver._partial.content.events) {{
events = receiver._partial.content.events;
}}
for (var event of events) {{
if ((event.kind === 'ModelChanged') && (event.attr === '{change}') &&
(cb_obj.id === event.model.id) &&
Expand Down

0 comments on commit 327f5b5

Please sign in to comment.