Allow None values for plot clicks or SI values
[hooke.git] / hooke / ui / gui / panel / plot.py
index 66cc64da4d1c2653b546b15512bddec153ef673d..602ee650024f5c3c6b5820c941e6a75dc385e4d9 100644 (file)
@@ -189,6 +189,8 @@ class PlotPanel (Panel, wx.Panel):
             return
         d = self._config.get('plot decimals', 2)
         x,y = (event.xdata, event.ydata)
+        if None in [x, y]:
+            return
         xt = ppSI(value=x, unit=self._x_unit, decimals=d)
         yt = ppSI(value=y, unit=self._y_unit, decimals=d)
         point_indexes = []