Skip to content

Commit

Permalink
[FIX] FreeViz: no crash when change class density and no data
Browse files Browse the repository at this point in the history
  • Loading branch information
jerneju committed Nov 20, 2017
1 parent 417c300 commit 2d006b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Orange/widgets/visualize/owfreeviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,8 @@ def _update_graph(self, reset_view=True, **_):
self.graph.update_data(self.variable_x, self.variable_y, reset_view)

def update_density(self):
if self.graph.data is None:
return
self._update_graph(reset_view=False)

def selection_changed(self):
Expand Down
9 changes: 9 additions & 0 deletions Orange/widgets/visualize/tests/test_owfreeviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,12 @@ def test_set_radius_no_data(self):
w = self.widget
self.send_signal(w.Inputs.data, None)
w.rslider.setSliderPosition(3)

def test_update_graph_no_data(self):
"""
Widget should not crash when there is no data and one wants to change class density etc.
GH-2780
"""
w = self.widget
self.send_signal(w.Inputs.data, None)
w.cb_class_density.click()

0 comments on commit 2d006b0

Please sign in to comment.