diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResource.java b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResource.java index 298f76b56..7e45b2b82 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResource.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResource.java @@ -27,6 +27,7 @@ import javax.ws.rs.GET; import javax.ws.rs.PUT; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; +import org.apache.guacamole.GuacamoleClientException; import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.net.auth.Directory; import org.apache.guacamole.net.auth.Identifiable; @@ -120,8 +121,15 @@ public class DirectoryObjectResource public ExternalType createObject(ExternalType object) throws GuacamoleException { + // Validate that data was provided + if (object == null) + throw new GuacamoleClientException("Data must be submitted when creating objects."); + // Create the new object within the directory directory.add(translator.toInternalObject(object));