File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
core/src/main/java/com/ibm/watson/developer_cloud/util Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -164,16 +164,18 @@ private CredentialUtils() {
164164 }
165165
166166 /**
167- * Returns true if the supplied value begins or ends with curly brackets or quotation marks.
167+ * Returns true if the supplied value begins or ends with curly brackets or quotation marks. Returns false for null
168+ * inputs.
168169 *
169170 * @param credentialValue the credential value to check
170171 * @return true if the value starts or ends with these characters and is therefore invalid
171172 */
172173 public static boolean hasBadStartOrEndChar (String credentialValue ) {
173- return credentialValue .startsWith ("{" )
174+ return credentialValue != null
175+ && (credentialValue .startsWith ("{" )
174176 || credentialValue .startsWith ("\" " )
175177 || credentialValue .endsWith ("}" )
176- || credentialValue .endsWith ("\" " );
178+ || credentialValue .endsWith ("\" " )) ;
177179 }
178180
179181 // VCAP-related methods
You can’t perform that action at this time.
0 commit comments