Better error in !imdb
This commit is contained in:
parent
42dc850105
commit
980a4a10d0
@ -18,7 +18,8 @@ namespace NadekoBot.Modules.Searches.Commands.OMDB
|
|||||||
{
|
{
|
||||||
var res = await http.GetStringAsync(String.Format(queryUrl,name.Trim().Replace(' ','+'))).ConfigureAwait(false);
|
var res = await http.GetStringAsync(String.Format(queryUrl,name.Trim().Replace(' ','+'))).ConfigureAwait(false);
|
||||||
var movie = JsonConvert.DeserializeObject<OmdbMovie>(res);
|
var movie = JsonConvert.DeserializeObject<OmdbMovie>(res);
|
||||||
|
if (movie?.Title == null)
|
||||||
|
return null;
|
||||||
movie.Poster = await NadekoBot.Google.ShortenUrl(movie.Poster);
|
movie.Poster = await NadekoBot.Google.ShortenUrl(movie.Poster);
|
||||||
return movie;
|
return movie;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user