Fix crash in "current" command when nothing is playing.

develop
Icedream 2015-11-06 23:27:31 +01:00
parent d1fe5f4d36
commit a74b923de0
1 changed files with 4 additions and 0 deletions

View File

@ -188,6 +188,10 @@ ts3clientService.on "started", (ts3proc) =>
switch name.toLowerCase() switch name.toLowerCase()
when "current" when "current"
item = vlc.playlist.items[vlc.playlist.currentItem] item = vlc.playlist.items[vlc.playlist.currentItem]
if not item?
ts3query?.sendtextmessage args.targetmode, invoker.id, "Not playing anything at the moment."
return
info = vlcMediaInfo[item.mrl] info = vlcMediaInfo[item.mrl]
url = info?.originalUrl or item.mrl url = info?.originalUrl or item.mrl
title = info?.title or item.mrl title = info?.title or item.mrl