Better error in !imdb

This commit is contained in:
Kwoth 2017-01-03 21:12:21 +01:00
parent 42dc850105
commit 980a4a10d0

View File

@ -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;
} }