Only try to regex match a youtube url if we actually have a search string

(youtube.py)
This commit is contained in:
jesopo 2019-01-11 12:03:23 +00:00
parent 59094568e0
commit e5a5241615

View file

@ -90,8 +90,9 @@ class Module(ModuleManager.BaseModule):
if last_youtube:
search = last_youtube.message
if search:
url_match = re.search(REGEX_YOUTUBE, search)
if search and url_match:
if url_match:
video_id = url_match.group(1)
if search or video_id: