Skip to content

accountlinks.tmpl: nil pointer evaluating oauth2.Provider.IconHTML #28667

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

Closed
cyclane opened this issue Dec 31, 2023 · 5 comments
Closed

accountlinks.tmpl: nil pointer evaluating oauth2.Provider.IconHTML #28667

cyclane opened this issue Dec 31, 2023 · 5 comments
Labels
Milestone

Comments

@cyclane
Copy link

cyclane commented Dec 31, 2023

Description

Description and suspected cause

It is possible to get a nil pointer for $providerData in accountlinks.tmpl. This then results in an error like:

An error occurred:

Render failed, failed to render template: user/settings/security/security, error: template error: builtin(bindata):user/settings/security/accountlinks:32:20 : executing "user/settings/security/accountlinks" at <$providerData.IconHTML>: nil pointer evaluating oauth2.Provider.IconHTML
----------------------------------------------------------------------
					{{$providerData.IconHTML 20}}
					               ^
----------------------------------------------------------------------

I haven't exactly figured out how to replicate this yet, but will investigate it myself. Just created the issue to keep track of my investigation into this.

Probably something to do with an error that is ignored here

Gitea Version

1.21.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response
Relevant logs are in description (they're short).

Screenshots

image

Git Version

2.40.1

Operating System

gitea/gitea Docker image on virtual Debian 12 host.

How are you running Gitea?

Unmodified gitea/gitea Docker image running on a virtual Debian 12 host with a mariadb 10 database.

Database

MySQL/MariaDB

@KN4CK3R
Copy link
Member

KN4CK3R commented Jan 1, 2024

I think it's related to #27798. The (old) problem was a deactivated provider is missed in the list but that should be fixed.

@cyclane
Copy link
Author

cyclane commented Jan 2, 2024

@KN4CK3R Thank you, I just tested nightly and the issue has been fixed there, so you're probably right.

@cyclane cyclane closed this as completed Jan 2, 2024
@KN4CK3R
Copy link
Member

KN4CK3R commented Jan 2, 2024

Oh, the fix was not backported. That explains why you get that error in the last release.

@mihkel
Copy link

mihkel commented Feb 13, 2024

Should be fixed in 1.22?

@lunny lunny reopened this Feb 17, 2024
@lunny lunny added this to the 1.21.6 milestone Feb 17, 2024
6543 pushed a commit that referenced this issue Feb 19, 2024
…counts (#29263)

The bug has been fixed on v1.22 but not backport to v1.21.
This original PR have many refactors so I don't think it's necessary to
backport all of them.

Fix #28667
@lunny
Copy link
Member

lunny commented Feb 20, 2024

Closed by #29263

@lunny lunny closed this as completed Feb 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants