Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2012-10-03 22:13:13 +0000
committerRoberto E. Escobar2012-10-03 22:13:13 +0000
commit2305aa6ea7f35441dff6790d3309b03e0604cc0f (patch)
tree49ee164378b1215c72db576479ee6c298a082942 /plugins/org.eclipse.osee.framework.core.client
parent1bce90ab3dfcafc4e075fa93e97081ecf9c30162 (diff)
downloadorg.eclipse.osee-2305aa6ea7f35441dff6790d3309b03e0604cc0f.tar.gz
org.eclipse.osee-2305aa6ea7f35441dff6790d3309b03e0604cc0f.tar.xz
org.eclipse.osee-2305aa6ea7f35441dff6790d3309b03e0604cc0f.zip
feature[ats_VYXJD]: Add checks to prevent NPE on empty name
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.client')
-rw-r--r--plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java
index e4f66640db1..145ffc92ab9 100644
--- a/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java
+++ b/plugins/org.eclipse.osee.framework.core.client/src/org/eclipse/osee/framework/core/client/internal/InternalClientSessionManager.java
@@ -133,9 +133,15 @@ public class InternalClientSessionManager {
@Override
public OseeCredential getCredential() {
OseeCredential credential = super.getCredential();
- String userName =
- OseeClientProperties.isInDbInit() ? SystemUser.BootStrap.getName() : System.getProperty(
- "user.name").toLowerCase();
+ String userName;
+ if (OseeClientProperties.isInDbInit()) {
+ userName = SystemUser.BootStrap.getName();
+ } else {
+ userName = System.getProperty("user.name", SystemUser.Guest.getName());
+ if (Strings.isValid(userName)) {
+ userName = userName.toLowerCase();
+ }
+ }
credential.setUserName(userName);
credential.setDomain("");
credential.setPassword("");

Back to the top