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

Avoid null error #8034

Merged

Conversation

chidozieononiwu
Copy link
Member

prevent null error at GetReviewsAsync by reviewIds

Copy link
Member

@praveenkuttappan praveenkuttappan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one question. But looks fine.

@@ -134,6 +134,10 @@ public async Task<ReviewListItemModel> GetReviewAsync(ClaimsPrincipal user, stri
/// <returns></returns>
public async Task<IEnumerable<ReviewListItemModel>> GetReviewsAsync(IEnumerable<string> reviewIds, bool? isClosed = null)
{
if (reviewIds == null || !reviewIds.Any())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which call path is passing it as null? Shouldn't we fetch all reviews when reviewIds is null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't need all reviews from this method. We only need revies with IDs specified so it implicitly expects at least one review ID

@chidozieononiwu chidozieononiwu merged commit 57a64de into Azure:main Apr 9, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants