-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Gitlab mirgration: invalid memory address or nil pointer #18434
Comments
gitea/services/migrations/gitlab.go Line 649 in 726715f
Is where the stacktrace it's pointing to. Clearly in this case the approvals.UpdatedAt pointer is nil and so dereferencing it produces a npe. approvals itself must not be nil as the other lines would fail. Clearly the code here has assumed that this value would always be set even though the pointer should have indicated that it was potentially not. I guess the simplest thing to do is to check if the time is present before dereferencing it but this likely means that the rest of the migration code has assumed things that it probably shouldn't have - so it could do with a check-up. |
Fallback to created_at if that the case and to time.Now() if it is also missing. Fixes: go-gitea#18434 Co-authored-by: Loïc Dachary <[email protected]> Conflicts: services/migrations/gitlab.go trivial context conflict because var reviews became reviews := in 1.17
Fallback to created_at if that the case and to time.Now() if it is also missing. Fixes: #18434 Co-authored-by: Loïc Dachary <[email protected]> Conflicts: services/migrations/gitlab.go trivial context conflict because var reviews became reviews := in 1.17
Gitea Version
1.17.0+dev-47-g8038610a4
Git Version
No response
Operating System
No response
How are you running Gitea?
Database
PostgreSQL
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
https://gist.github.com/anbraten/17a91226dbca85be5dae8a9541da4523
Description
Getting an error while gitea tries to migrate pull-requests from Gitlab:
Screenshots
No response
The text was updated successfully, but these errors were encountered: