Only try to regex match a youtube url if we actually have a search string
(youtube.py)
This commit is contained in:
parent
59094568e0
commit
e5a5241615
1 changed files with 4 additions and 3 deletions
|
@ -90,9 +90,10 @@ class Module(ModuleManager.BaseModule):
|
|||
if last_youtube:
|
||||
search = last_youtube.message
|
||||
|
||||
url_match = re.search(REGEX_YOUTUBE, search)
|
||||
if search and url_match:
|
||||
video_id = url_match.group(1)
|
||||
if search:
|
||||
url_match = re.search(REGEX_YOUTUBE, search)
|
||||
if url_match:
|
||||
video_id = url_match.group(1)
|
||||
|
||||
if search or video_id:
|
||||
safe_setting = event["target"].get_setting("youtube-safesearch",
|
||||
|
|
Loading…
Reference in a new issue