From 55a16d09ddac410f2191df49c90e858ad9a6f096 Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Wed, 4 Jan 2017 23:05:11 +0200 Subject: Handle URLs of unknown actions properly --- local/handler/UnknownHandler.py | 2 +- 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 -- cgit v1.2.3