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

Closed
opened 2025-11-02 10:04:11 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @cyclane on GitHub (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

Originally created by @cyclane on GitHub (Dec 31, 2023). ### Description #### Description and suspected cause It is possible to get a `nil` pointer for `$providerData` in [accountlinks.tmpl](https://github.com/go-gitea/gitea/blob/f8a1bad883aa4697b4001f74e2074898d7162aef/templates/user/settings/security/accountlinks.tmpl#L30). 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](https://github.com/go-gitea/gitea/blob/da58bb85fa4ff8a37f843d09452b4244b18f93ce/routers/web/user/setting/security/security.go#L91) ### 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](https://github.com/go-gitea/gitea/assets/38599423/7b0ddd9a-620f-44c4-9c00-b62194b1bd58) ### 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](https://hub.docker.com/r/gitea/gitea/) running on a virtual Debian 12 host with a mariadb 10 database. ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 10:04:11 -06:00
Author
Owner

@KN4CK3R commented on GitHub (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.

@KN4CK3R commented on GitHub (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.
Author
Owner

@cyclane commented on GitHub (Jan 2, 2024):

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

@cyclane commented on GitHub (Jan 2, 2024): @KN4CK3R Thank you, I just tested nightly and the issue has been fixed there, so you're probably right.
Author
Owner

@KN4CK3R commented on GitHub (Jan 2, 2024):

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

@KN4CK3R commented on GitHub (Jan 2, 2024): Oh, the fix was not backported. That explains why you get that error in the last release.
Author
Owner

@mihkel commented on GitHub (Feb 13, 2024):

Should be fixed in 1.22?

@mihkel commented on GitHub (Feb 13, 2024): Should be fixed in 1.22?
Author
Owner

@lunny commented on GitHub (Feb 20, 2024):

Closed by #29263

@lunny commented on GitHub (Feb 20, 2024): Closed by #29263
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12275