[Bug][FsBroker] NPE throw when username is empty (#3731)
When using Broker with an empty username, a NPE is thrown, which is not expected.
This commit is contained in:
@ -335,7 +335,7 @@ public class FileSystemManager {
|
||||
conf.set(FS_HDFS_IMPL_DISABLE_CACHE, "true");
|
||||
FileSystem dfsFileSystem = null;
|
||||
if (authentication.equals(AUTHENTICATION_SIMPLE) &&
|
||||
properties.containsKey(USER_NAME_KEY)) {
|
||||
properties.containsKey(USER_NAME_KEY) && !Strings.isNullOrEmpty(username)) {
|
||||
// Use the specified 'username' as the login name
|
||||
UserGroupInformation ugi = UserGroupInformation.createRemoteUser(username);
|
||||
dfsFileSystem = ugi.doAs(new PrivilegedExceptionAction<FileSystem>() {
|
||||
|
||||
Reference in New Issue
Block a user