diff --git a/plugins/github/src/org/jetbrains/plugins/github/GithubSettings.java b/plugins/github/src/org/jetbrains/plugins/github/GithubSettings.java index 39a3360c506c..ffbc9fae1e7b 100644 --- a/plugins/github/src/org/jetbrains/plugins/github/GithubSettings.java +++ b/plugins/github/src/org/jetbrains/plugins/github/GithubSettings.java @@ -53,7 +53,7 @@ public class GithubSettings implements PersistentStateComponent task) throws IOException { GithubAuthData auth = GithubSettings.getInstance().getAuthData(); try { + if (auth.getAuthType() == GithubAuthData.AuthType.ANONYMOUS) { + throw new AuthenticationException("Settings authentication not set"); + } task.consume(auth); return auth; } @@ -94,6 +97,9 @@ public class GithubUtil { @NotNull ThrowableConvertor task) throws IOException { GithubAuthData auth = GithubSettings.getInstance().getAuthData(); try { + if (auth.getAuthType() == GithubAuthData.AuthType.ANONYMOUS) { + throw new AuthenticationException("Settings authentication not set"); + } return task.convert(auth); } catch (AuthenticationException e) {