add checking null and blank values in the putCredentials method.

This commit is contained in:
astroshim 2016-06-18 22:40:15 +09:00
parent 03717018b8
commit 9b2c1c98db

View file

@ -17,6 +17,7 @@
package org.apache.zeppelin.rest;
import com.google.common.base.Strings;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.apache.zeppelin.user.Credentials;
@ -70,7 +71,8 @@ public class CredentialRestApi {
String username = messageMap.get("username");
String password = messageMap.get("password");
if (entity == null || username == null || password == null) {
if (Strings.isNullOrEmpty(entity)
|| Strings.isNullOrEmpty(username) || Strings.isNullOrEmpty(password) ) {
return new JsonResponse(Status.BAD_REQUEST).build();
}