Skip to content

Commit aabfc86

Browse files
committed
fix npe error
1 parent 291012d commit aabfc86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/gitdiff/gitdiff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ func GetDiffShortStat(gitRepo *git.Repository, beforeCommitID, afterCommitID str
13391339
// Additionally, the database is updated asynchronously if files have changed since the last review
13401340
func SyncUserSpecificDiff(ctx context.Context, userID int64, pull *issues_model.PullRequest, gitRepo *git.Repository, diff *Diff, opts *DiffOptions) (*pull_model.ReviewState, error) {
13411341
review, err := pull_model.GetNewestReviewState(ctx, userID, pull.ID)
1342-
if err != nil {
1342+
if err != nil || review == nil || review.UpdatedFiles == nil {
13431343
return nil, err
13441344
}
13451345
if len(review.UpdatedFiles) == 0 {

0 commit comments

Comments
 (0)