From ca71de57a1345ae83e40672708121ef91b31e118 Mon Sep 17 00:00:00 2001 From: BoppreH Date: Sun, 4 May 2014 00:47:23 -0300 Subject: [PATCH] Don't search for empty games --- steamgrid.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/steamgrid.go b/steamgrid.go index a293bf8..071315f 100644 --- a/steamgrid.go +++ b/steamgrid.go @@ -148,6 +148,10 @@ const googleSearchFormat = `https://ajax.googleapis.com/ajax/services/search/ima // Returns the first steam grid image URL found by Google search of a given // game name. func getGoogleImage(gameName string) (string, error) { + if gameName == "" { + return "", nil + } + url := googleSearchFormat + url.QueryEscape("steam grid OR header"+gameName) response, err := http.Get(url) if err != nil {