Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic plugin bad at handling empty topics #157

Open
alanbriolat opened this issue Jun 3, 2019 · 0 comments
Open

Topic plugin bad at handling empty topics #157

alanbriolat opened this issue Jun 3, 2019 · 0 comments

Comments

@alanbriolat
Copy link
Member

alanbriolat commented Jun 3, 2019

Exceptions happen when the !topic command is used in a channel with no topic. Ideally should add test coverage and then fix the behaviour.

Empty topic represented as None?

Traceback (most recent call last):
  File "/app/csbot/core.py", line 175, in fire_command
    yield from f(event)
  File "/usr/lib/python3.6/asyncio/coroutines.py", line 212, in coro
    res = func(*args, **kw)
  File "/app/csbot/plugin.py", line 30, in __call__
    return getattr(self.obj, self.name)(*args, **kwargs)
  File "/app/csbot/plugins/topic.py", line 117, in topic_append
    parts = self._split_topic(delim, self._get_topic(e['channel']))
  File "/app/csbot/plugins/topic.py", line 59, in _split_topic
    return [s.strip() for s in topic.split(sep)]
AttributeError: 'NoneType' object has no attribute 'split'

No observed TOPIC message?

Traceback (most recent call last):
  File "/app/csbot/core.py", line 175, in fire_command
    yield from f(event)
  File "/usr/lib/python3.6/asyncio/coroutines.py", line 212, in coro
    res = func(*args, **kw)
  File "/app/csbot/plugin.py", line 30, in __call__
    return getattr(self.obj, self.name)(*args, **kwargs)
  File "/app/csbot/plugins/topic.py", line 89, in topic
    topic = self._get_topic(e['channel'])
  File "/app/csbot/plugins/topic.py", line 71, in _get_topic
    return self.topics[channel][-1]
IndexError: deque index out of range
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant