Fix AttributeError by checking if self.playlist is None