From 6399f29aaa6818d6169515485d24b9c2f896d542 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 15 Jul 2013 16:07:35 +0400 Subject: [PATCH] Github: correct check on fresh config --- .../src/org/jetbrains/plugins/github/GithubSettings.java | 5 ++++- .../github/src/org/jetbrains/plugins/github/GithubUtil.java | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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) {