diff --git a/acme/adders/reverb/structured.py b/acme/adders/reverb/structured.py index b99f171589..de2b712057 100644 --- a/acme/adders/reverb/structured.py +++ b/acme/adders/reverb/structured.py @@ -153,7 +153,7 @@ def add(self, extras: types.NestedArray = ()): """Record an action and the following timestep.""" - if not self._writer.step_is_open: + if self._writer is None or not self._writer.step_is_open: raise ValueError('adder.add_first must be called before adder.add.') # Add the timestep to the buffer.