Skip to content

Commit d089b45

Browse files
authored
Fix Nonetype has no attribute SetVisibility in _coreg.py [reopen of #13209] (#13218)
1 parent f6c6bd7 commit d089b45

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

doc/changes/devel/13218.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix bug where :func:`mne.gui.coregistration` would emit an error for some CTF datasets, by :newcontrib:`Wei Xu`.

doc/changes/names.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@
317317
.. _Velu Prabhakar Kumaravel: https://github.com/vpKumaravel
318318
.. _Victor Ferat: https://github.com/vferat
319319
.. _Victoria Peterson: https://github.com/vpeterson
320+
.. _Wei Xu: https://github.com/psyxw
320321
.. _Will Turner: https://bootstrapbill.github.io
321322
.. _Xabier de Zuazo: https://github.com/zuazo
322323
.. _Xiaokai Xia: https://github.com/dddd1007

mne/gui/_coreg.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,10 @@ def _set_sensors_visibility(self, state):
11941194
actors = self._actors[sensor]
11951195
actors = actors if isinstance(actors, list) else [actors]
11961196
for actor in actors:
1197+
if actor is None:
1198+
continue
11971199
actor.SetVisibility(state)
1200+
11981201
self._renderer._update()
11991202

12001203
def _update_actor(self, actor_name, actor):

0 commit comments

Comments
 (0)