diff --git a/src/pynwb/misc.py b/src/pynwb/misc.py index d6c079ef7..5c4ad659b 100644 --- a/src/pynwb/misc.py +++ b/src/pynwb/misc.py @@ -186,6 +186,8 @@ def add_unit(self, **kwargs): if self.__electrode_table is None: nwbfile = self.get_ancestor(data_type='NWBFile') elec_col.table = nwbfile.electrodes + if elec_col.table is None: + warnings.warn('Reference to electrode table that does not yet exist') else: elec_col.table = self.__electrode_table