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