Skip to content

Result of userprofile is null if fields is not present #15

@calledude

Description

@calledude

SlackApiClient.UserProfile.Get() returns null if Fields isn't present in the result.

It tries to deserialize an array into a dictionary, which causes the JSON parser to freak out. This is evident when using JsonConvert.DeserializeObject<UserProfileResponse>(string result) instead of this:

private T Deserialize<T>(WebApiResponse response) where T : class =>

If Fields is empty/null, it'll throw, whereas JObject.ToObject() won't.

public IDictionary<string, UserProfileField> Fields { get; set; } = new Dictionary<string, UserProfileField>();

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions