Browse Source

Merge pull request #1435 from flaix/fix-authority-np

Fix crash in Gitblit Authority for deleted users
pull/1277/merge
Florian Zschocke 1 year ago
parent
commit
66365658af
No account linked to committer's email address
2 changed files with 7 additions and 2 deletions
  1. 2
    1
      releases.moxie
  2. 5
    1
      src/main/java/com/gitblit/authority/GitblitAuthority.java

+ 2
- 1
releases.moxie View File

@@ -11,7 +11,8 @@ r34: {
html: ~
text: ~
security: ~
fixes: ~
fixes:
- Fix crash in Gitblit Authority when users were deleted from Gitblit but still had entries (certificates) in the Authority.
changes:
- Minimum Java required increased to Java 8
additions: ~

+ 5
- 1
src/main/java/com/gitblit/authority/GitblitAuthority.java View File

@@ -299,7 +299,11 @@ public class GitblitAuthority extends JFrame implements X509Log {
List<UserCertificateModel> list = UserCertificateConfig.KEY.parse(config).list;
for (UserCertificateModel ucm : list) {
ucm.user = userService.getUserModel(ucm.user.username);
map.put(ucm.user.username, ucm);
// Users may have been deleted, but are still present in authority.conf.
// TODO: Currently this only keeps the app from crashing. It should provide means to show obsolete user entries and delete them.
if (ucm.user != null) {
map.put(ucm.user.username, ucm);
}
}
} catch (IOException e) {
e.printStackTrace();

Loading…
Cancel
Save