mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUAC-1181: Consider null to be empty.
This commit is contained in:
@@ -154,7 +154,7 @@ public class ConnectionService extends ModeledGroupedDirectoryObjectService<Mode
|
||||
super.beforeCreate(user, model);
|
||||
|
||||
// Name must not be blank
|
||||
if (model.getName().trim().isEmpty())
|
||||
if (model.getName() == null || model.getName().trim().isEmpty())
|
||||
throw new GuacamoleClientException("Connection names must not be blank.");
|
||||
|
||||
// Do not attempt to create duplicate connections
|
||||
@@ -171,7 +171,7 @@ public class ConnectionService extends ModeledGroupedDirectoryObjectService<Mode
|
||||
super.beforeUpdate(user, model);
|
||||
|
||||
// Name must not be blank
|
||||
if (model.getName().trim().isEmpty())
|
||||
if (model.getName() == null || model.getName().trim().isEmpty())
|
||||
throw new GuacamoleClientException("Connection names must not be blank.");
|
||||
|
||||
// Check whether such a connection is already present
|
||||
@@ -212,7 +212,7 @@ public class ConnectionService extends ModeledGroupedDirectoryObjectService<Mode
|
||||
String value = parameterEntry.getValue();
|
||||
|
||||
// There is no need to insert empty parameters
|
||||
if (value.isEmpty())
|
||||
if (value == null || value.isEmpty())
|
||||
continue;
|
||||
|
||||
// Produce model object from parameter
|
||||
|
@@ -137,7 +137,7 @@ public class ConnectionGroupService extends ModeledGroupedDirectoryObjectService
|
||||
super.beforeCreate(user, model);
|
||||
|
||||
// Name must not be blank
|
||||
if (model.getName().trim().isEmpty())
|
||||
if (model.getName() == null || model.getName().trim().isEmpty())
|
||||
throw new GuacamoleClientException("Connection group names must not be blank.");
|
||||
|
||||
// Do not attempt to create duplicate connection groups
|
||||
@@ -154,7 +154,7 @@ public class ConnectionGroupService extends ModeledGroupedDirectoryObjectService
|
||||
super.beforeUpdate(user, model);
|
||||
|
||||
// Name must not be blank
|
||||
if (model.getName().trim().isEmpty())
|
||||
if (model.getName() == null || model.getName().trim().isEmpty())
|
||||
throw new GuacamoleClientException("Connection group names must not be blank.");
|
||||
|
||||
// Check whether such a connection group is already present
|
||||
|
@@ -144,7 +144,7 @@ public class UserService extends ModeledDirectoryObjectService<ModeledUser, User
|
||||
super.beforeCreate(user, model);
|
||||
|
||||
// Username must not be blank
|
||||
if (model.getIdentifier().trim().isEmpty())
|
||||
if (model.getIdentifier() == null || model.getIdentifier().trim().isEmpty())
|
||||
throw new GuacamoleClientException("The username must not be blank.");
|
||||
|
||||
// Do not create duplicate users
|
||||
@@ -161,7 +161,7 @@ public class UserService extends ModeledDirectoryObjectService<ModeledUser, User
|
||||
super.beforeUpdate(user, model);
|
||||
|
||||
// Username must not be blank
|
||||
if (model.getIdentifier().trim().isEmpty())
|
||||
if (model.getIdentifier() == null || model.getIdentifier().trim().isEmpty())
|
||||
throw new GuacamoleClientException("The username must not be blank.");
|
||||
|
||||
// Check whether such a user is already present
|
||||
|
Reference in New Issue
Block a user