fixed crash when an exception is thrown off the bat (eg. can't open serial port)

This commit is contained in:
Kienan Stewart 2015-08-12 20:17:52 -04:00
parent 8efbcd935b
commit 3fe30ed27a
1 changed files with 6 additions and 2 deletions

View File

@ -513,7 +513,11 @@ class PlotWidget(Image):
if 'data' in point and 'time' in point and 'temperature' in point['data']: if 'data' in point and 'time' in point and 'temperature' in point['data']:
points.append(numpy.array([(point['time'], point['data']['temperature'])], points.append(numpy.array([(point['time'], point['data']['temperature'])],
dtype=float, ndmin =2)) dtype=float, ndmin =2))
extra_data = numpy.array(list(), dtype = float)
if points:
extra_data = numpy.vstack(tuple(points)) extra_data = numpy.vstack(tuple(points))
if not extra_data.any():
return
if not self.data.any(): if not self.data.any():
self.data = extra_data self.data = extra_data
return return