diff --git a/csdr/chain/__init__.py b/csdr/chain/__init__.py index 99fe821..b9af86a 100644 --- a/csdr/chain/__init__.py +++ b/csdr/chain/__init__.py @@ -115,7 +115,7 @@ class Chain(Module): removedWorker.stop() if index == 0: - if self.reader is not None: + if self.reader is not None and len(self.workers): self.workers[0].setReader(self.reader) elif index == len(self.workers): if self.writer is not None: