diff options
author | kongr45gpen <electrovesta@gmail.com> | 2017-01-04 23:05:11 +0200 |
---|---|---|
committer | kongr45gpen <electrovesta@gmail.com> | 2017-01-04 23:05:11 +0200 |
commit | 55a16d09ddac410f2191df49c90e858ad9a6f096 (patch) | |
tree | 5ac83dba8a410fc9e8ccb235cae56039a8bea5b7 | |
parent | 5e10087299609505d723bf3c51aa0913a13f2f3f (diff) | |
download | supybot_github-55a16d09ddac410f2191df49c90e858ad9a6f096.tar.gz supybot_github-55a16d09ddac410f2191df49c90e858ad9a6f096.tar.bz2 supybot_github-55a16d09ddac410f2191df49c90e858ad9a6f096.zip |
Handle URLs of unknown actions properly
-rw-r--r-- | local/handler/UnknownHandler.py | 2 | ||||
-rw-r--r-- | local/utility.py | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/local/handler/UnknownHandler.py b/local/handler/UnknownHandler.py index e158512..00557ec 100644 --- a/local/handler/UnknownHandler.py +++ b/local/handler/UnknownHandler.py @@ -18,5 +18,5 @@ def handle(data, theme): eventType = data['eventType'], action = action, actor = actor, - url = url + url = getShortURL(url) ) diff --git a/local/utility.py b/local/utility.py index 1a7954a..0f3a0ca 100644 --- a/local/utility.py +++ b/local/utility.py @@ -110,7 +110,9 @@ def colorAction(action): def getShortURL(longurl): """ Returns a short URL generated by git.io""" - if configValue("hideURL") is True: + if longurl is None: + return None + elif configValue("hideURL") is True: return None if configValue("shortURL") is False or not getShortURL.github.match(longurl): url = longurl |