Skip to content

Commit

Permalink
feat: added check for empty list in _avg_dipole_check
Browse files Browse the repository at this point in the history
  • Loading branch information
gtdang committed Aug 23, 2024
1 parent 0e047c9 commit 3271b83
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hnn_core/gui/_viz_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ def _dynamic_rerender(fig):
def _avg_dipole_check(dpls):
"""Check for averaged dipole, else average the trials"""
# Check if there is an averaged dipole already
if not dpls:
return None

avg_dpls = [d for d in dpls if d.nave > 1]
if avg_dpls:
dpl = avg_dpls[0]
Expand Down

0 comments on commit 3271b83

Please sign in to comment.