From 5dacf553c1e71d37ba380b64c22600d51a694339 Mon Sep 17 00:00:00 2001
From: ldam <ldam@passcal.nmt.edu>
Date: Wed, 30 Aug 2023 13:34:18 -0600
Subject: [PATCH] make sure clicking on plotting area before getting chan
 attribute of ax

---
 .../view/plotting/plotting_widget/plotting_widget.py          | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
index 970ba1903..699eeccb5 100755
--- a/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
+++ b/sohstationviewer/view/plotting/plotting_widget/plotting_widget.py
@@ -296,9 +296,9 @@ class PlottingWidget(QtWidgets.QScrollArea):
             focus SOH tab, roll to the corresponding line.
         """
         artist = event.artist
-        ax = artist.axes
-        chan_id = ax.chan
         if isinstance(artist, pl.Line2D):
+            ax = artist.axes
+            chan_id = ax.chan
             chan_data = self.plotting_data1[chan_id]
             # list of x values of the plot
             x_list = artist.get_xdata()
-- 
GitLab