Skip to content

Commit a1ee11a

Browse files
committed
actually swap to hasattr
1 parent 071f167 commit a1ee11a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nwbinspector/checks/icephys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
@register_check(importance=Importance.BEST_PRACTICE_VIOLATION, neurodata_type=IntracellularElectrode)
77
def check_intracellular_electrode_cell_id_exists(intracellular_electrode: IntracellularElectrode):
88
"""Check if the IntracellularElectrode contains a cell_id."""
9-
if getattr(intracellular_electrode, "cell_id", "") is None: # Will only be None with PyNWB>=2.1.0
9+
if hasattr(intracellular_electrode, "cell_id") and intracellular_electrode.cell_id is None:
1010
return InspectorMessage(message="Please include a unique cell_id associated with this IntracellularElectrode.")

0 commit comments

Comments
 (0)