Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid King2014-02-26 04:36:37 +0000
committerDavid King2014-02-26 04:38:20 +0000
commit9a45470c9411e8f3cde842af43fcadb7c4d5f900 (patch)
tree1f125f6f4cb4fdd1af2c55a58834e15daba09f6a /org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn
parentbb4ca77e42fbd5032c9211d53a6f9ad2ca798cf9 (diff)
downloadorg.eclipse.mylyn.tasks-9a45470c9411e8f3cde842af43fcadb7c4d5f900.tar.gz
org.eclipse.mylyn.tasks-9a45470c9411e8f3cde842af43fcadb7c4d5f900.tar.xz
org.eclipse.mylyn.tasks-9a45470c9411e8f3cde842af43fcadb7c4d5f900.zip
Add missing null checks when handling repository credentials in Trac
connector Change-Id: Ic9cb1cffbbeb4cb5024557d8521c03df19568ce3 Signed-off-by: David King <david.king@tasktop.com>
Diffstat (limited to 'org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn')
-rw-r--r--org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
index 61ba37846..3c266560d 100644
--- a/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
+++ b/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/ui/TracRepositorySettingsPageTest.java
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
import org.eclipse.mylyn.internal.tasks.ui.wizards.EditRepositoryWizard;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
@@ -105,8 +106,9 @@ public class TracRepositorySettingsPageTest extends TestCase {
TaskRepository repository = fixture.repository();
page.setAnonymous(false);
page.setUrl(repository.getRepositoryUrl());
- page.setUserId(repository.getCredentials(AuthenticationType.REPOSITORY).getUserName());
- page.setPassword(repository.getCredentials(AuthenticationType.REPOSITORY).getPassword());
+ AuthenticationCredentials credentials = repository.getCredentials(AuthenticationType.REPOSITORY);
+ page.setUserId(credentials == null ? null : credentials.getUserName());
+ page.setPassword(credentials == null ? null : credentials.getPassword());
page.setTracVersion(fixture.getAccessMode());
validator = page.new TracValidator(page.createTaskRepository(), fixture.getAccessMode());

Back to the top