From 15c99bc2d868a314e770e49b9202d15c4b83c95e Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Fri, 18 Jan 2019 09:15:01 +0000 Subject: [PATCH] Add empty check to password --- .../jenkins/plugins/bfa/db/MongoDBKnowledgeBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/sonyericsson/jenkins/plugins/bfa/db/MongoDBKnowledgeBase.java b/src/main/java/com/sonyericsson/jenkins/plugins/bfa/db/MongoDBKnowledgeBase.java index 1a0042a9..c4cb505a 100644 --- a/src/main/java/com/sonyericsson/jenkins/plugins/bfa/db/MongoDBKnowledgeBase.java +++ b/src/main/java/com/sonyericsson/jenkins/plugins/bfa/db/MongoDBKnowledgeBase.java @@ -1022,7 +1022,7 @@ public Descriptor getDescriptor() { */ private MongoClient getMongoConnection() { if (mongo == null) { - if (password != null && password.getPlainText() != null) { + if (password != null && Util.fixEmpty(password.getPlainText()) != null) { char[] pwd = password.getPlainText().toCharArray(); MongoCredential credential = MongoCredential.createCredential(userName, dbName, pwd);