Skip to content
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

Fix crash when trying to view empty auth token list #2301

Merged
merged 1 commit into from
Feb 24, 2018

Conversation

HebaruSan
Copy link
Member

Problem

If you have never added any auth tokens (and therefore don't have the registry key HKEY_CURRENT_USER\Software\CKAN\AuthTokens), you may receive a null reference exception if you:

  • Open the GUI settings window
  • Edit the auth tokens in consoleui
  • Run ckan authtoken list

This can be worked around by adding a fake auth token, which you may have to do from the command line with ckan authtoken add host token.

Cause

Win32Registry.GetAuthTokenHosts() returns null because Microsoft.Win32.Registry.CurrentUser.OpenSubKey returns null.

Changes

Now Win32Registry.GetAuthTokenHosts() returns a zero-element string array if Microsoft.Win32.Registry.CurrentUser.OpenSubKey returns null.

Fixes #2300.

@HebaruSan HebaruSan added Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Pull request and removed Bug Something is not working as intended labels Feb 23, 2018
@HebaruSan HebaruSan changed the title Fix crash when trying to view auth empty token list Fix crash when trying to view empty auth token list Feb 24, 2018
@politas
Copy link
Member

politas commented Feb 24, 2018

Strange. It worked fine when I added my authtoken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants