Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetChangeHistory() NullReferenceException in JArray conversion for Change with ProjectActivityItem changed from Null to Something #117

Closed
vvkirik1 opened this issue Feb 8, 2022 · 2 comments
Assignees

Comments

@vvkirik1
Copy link

vvkirik1 commented Feb 8, 2022

Expected behavior

Get proper changeHistory of an issue by IIssuesService.GetChangeHistoryForIssue(issueId).Result

Actual behavior

In YouTrackSharp.Issues.IssuesService => GetChangeHistoryForIssue() at the end conversion from ActivityItem to Change via Change.FromApiEntity() proceeds, during which Activities with type ProjectActivityItem type setting From/To Value property with new JArray creating JObject from Activity.Removed and Activity.Added properties.
However, during JObject.FromObject() method ValidationUtils.ArgumentNotNull called which throws NullReferenceException cause of input parameter (Activity.Removed property in my case) being Null

Steps to reproduce the behavior

Try to GetChangeHistoryForIssue() of Issue that has ActivityItem like this:


{
"removed": null,
"added": {
"numberInProject": 1311,
"project": {
"shortName": "PRJCT"
},
"id": "95-6922",
"$type": "DatabaseIssueKey"
},
"targetMember": "project",
"category": {
"id": "ProjectCategory",
"$type": "ActivityCategory"
},
"timestamp": 1633610245836,
"field": {
"presentation": "project",
"id": "project",
"$type": "PredefinedFilterField"
},
"id": "0-0.76-8449959",
"type": "MODIFY_LINK",
"target": {
"created": 1633512386476,
"usesMarkdown": true,
"id": "74-543473",
"$type": "Issue"
},
"$type": "ProjectActivityItem"
}


@vvkirik1
Copy link
Author

vvkirik1 commented Feb 9, 2022

Any workarounds tho?

@rekolobov
Copy link
Member

My apologies for the extremely late reply,
Issue was fixed in the scope of 2022.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants