Merge pull request #430 from nimesh-madhavan/category_guard

guard against CategoryArray being null
This commit is contained in:
Scott Lovegrove 2016-03-24 15:09:18 +00:00
commit 69ea434f36
1 changed files with 1 additions and 1 deletions

View File

@ -335,7 +335,7 @@ namespace OpenLiveWriter.BlogClient.Clients
{
var json = reader.ReadToEnd();
var item = JsonConvert.DeserializeObject<CategoryResponse>(json);
var cats = item?.Feed?.CategoryArray.Select(x => new BlogPostCategory(x.Term));
var cats = item?.Feed?.CategoryArray?.Select(x => new BlogPostCategory(x.Term));
categories = cats?.ToArray() ?? new BlogPostCategory[0];
}
}