airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Fixed npe with credential token
Date Mon, 14 Dec 2015 22:00:45 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 89d879e49 -> 0a2b24c0a


Fixed npe with credential token


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/0a2b24c0
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/0a2b24c0
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/0a2b24c0

Branch: refs/heads/master
Commit: 0a2b24c0a2bb3e4c1dfbedee98270a52646d62ba
Parents: 89d879e
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Mon Dec 14 17:00:40 2015 -0500
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Mon Dec 14 17:00:40 2015 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/airavata/gfac/impl/Factory.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/0a2b24c0/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
index 2f2d947..0ab85ca 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java
@@ -260,7 +260,7 @@ public abstract class Factory {
             ComputeResourcePreference computeResourcePreference = pc.getComputeResourcePreference();
             String loginUserName = computeResourcePreference.getLoginUserName();
             String credentialStoreToken = computeResourcePreference.getResourceSpecificCredentialStoreToken();
-            if (credentialStoreToken == null && credentialStoreToken.isEmpty()) {
+            if (credentialStoreToken == null || credentialStoreToken.isEmpty()) {
                 credentialStoreToken = pc.getGatewayResourceProfile().getCredentialStoreToken();
             }
             return getSshKeyAuthentication(pc.getGatewayId(),loginUserName, credentialStoreToken);
@@ -274,7 +274,7 @@ public abstract class Factory {
             StoragePreference storagePreference = pc.getStoragePreference();
             String loginUserName = storagePreference.getLoginUserName();
             String credentialStoreToken = storagePreference.getResourceSpecificCredentialStoreToken();
-            if (credentialStoreToken == null && credentialStoreToken.isEmpty()) {
+            if (credentialStoreToken == null || credentialStoreToken.isEmpty()) {
                 credentialStoreToken = pc.getGatewayResourceProfile().getCredentialStoreToken();
             }
             return getSshKeyAuthentication(pc.getGatewayId(), loginUserName, credentialStoreToken);


Mime
View raw message