From 508afd963a0314afb807926b0c0420ed610d4226 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Fri, 7 Aug 2015 13:54:44 +0100 Subject: [PATCH] Fixed check for error in youtube link --- service_youtube.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service_youtube.go b/service_youtube.go index 12b925c..62c422f 100644 --- a/service_youtube.go +++ b/service_youtube.go @@ -96,7 +96,11 @@ func (yt YouTube) NewRequest(user *gumble.User, url string) (string, error) { startOffset = matches[0][2] } song, err := yt.NewSong(user.Name, shortURL, startOffset, nil) - return song.Title(), err + if !isNil(song) { + return song.Title(), err + } else { + return "", err + } } } else { return "", err