diff -r 3216bf5f711d -r 629680fb0582 GraphicViewer.py --- a/GraphicViewer.py Sat May 19 12:40:53 2012 +0200 +++ b/GraphicViewer.py Mon May 21 09:59:44 2012 +0200 @@ -507,14 +507,15 @@ ## Refresh the variable cursor. # @param dc The draw canvas def RefreshCursor(self, dc=None): - if dc is None: - dc = wx.BufferedDC(wx.ClientDC(self.Canvas.canvas), self.Canvas._Buffer) - - # Erase previous time cursor if drawn - if self.LastCursor is not None: - self.DrawCursor(dc, *self.LastCursor) - - # Draw new time cursor - if self.CursorIdx is not None: - self.LastCursor = self.Datas[self.CursorIdx] - self.DrawCursor(dc, *self.LastCursor) + if self: + if dc is None: + dc = wx.BufferedDC(wx.ClientDC(self.Canvas.canvas), self.Canvas._Buffer) + + # Erase previous time cursor if drawn + if self.LastCursor is not None: + self.DrawCursor(dc, *self.LastCursor) + + # Draw new time cursor + if self.CursorIdx is not None: + self.LastCursor = self.Datas[self.CursorIdx] + self.DrawCursor(dc, *self.LastCursor)