Skip to content

Commit

Permalink
Deal with case where get_array returns None
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jan 25, 2019
1 parent e675dd0 commit 35b3261
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion glue/viewers/image/frb_artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ def array_func_wrapper(self, bins=None, range=None):
ny, nx = bins
(ymin, ymax), (xmin, xmax) = range
bounds = [(ymin, ymax, ny), (xmin, xmax, nx)]
return self._array_maker.get_array(bounds)
array = self._array_maker.get_array(bounds)
if array is None:
return np.array([[np.nan]])
else:
return array

def set_array_maker(self, array_maker):
self._array_maker = array_maker
Expand Down

0 comments on commit 35b3261

Please sign in to comment.