Check buffer is non-empty before peeking

This commit is contained in:
Tim Field 2009-11-16 21:01:03 +00:00
parent 6735e09903
commit e9721c7800
1 changed files with 1 additions and 1 deletions

View File

@ -332,7 +332,7 @@ class RxPlotFrame(wx.Frame):
plot_datax.extend(datax)
plot_datay.extend(datay)
if self.buffer_size > 0:
if len(plot_datax) > 0 and self.buffer_size > 0:
xcutoff = plot_datax[-1] - self.buffer_size
while len(plot_datax) > 0 and plot_datax[0] < xcutoff:
plot_datax.popleft()