Skip to content

Commit

Permalink
Ensure viewer_selected is set before centering on data
Browse files Browse the repository at this point in the history
  • Loading branch information
duytnguyendtn committed Oct 12, 2024
1 parent 7925afc commit a2b8890
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def vue_center_on_data(self, event=None):
return
# If plugin is in "Manual" mode, we should never
# autocenter and potentially wipe the user's data
if self.viewer_selected == "Manual":
if not self.viewer_selected or self.viewer_selected == "Manual":
return

# If the user panned but tracking not enabled, don't recenter
Expand All @@ -143,8 +143,7 @@ def vue_center_on_data(self, event=None):
return

# gets the current viewer
if self.viewer_selected:
viewer = self.viewer.selected_obj
viewer = self.viewer.selected_obj

# nothing happens in the case there is no image in the viewer
# additionally if the data does not have WCS
Expand Down

0 comments on commit a2b8890

Please sign in to comment.