Check that author and group names aren't empty.

This commit is contained in:
akwizgran
2014-01-31 17:23:14 +00:00
parent 93890d56f6
commit cde4ca574f
9 changed files with 26 additions and 9 deletions

View File

@@ -1,5 +1,7 @@
package org.briarproject.api;
import static org.briarproject.api.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
/** A pseudonym for a user. */
public class Author {
@@ -8,6 +10,8 @@ public class Author {
private final byte[] publicKey;
public Author(AuthorId id, String name, byte[] publicKey) {
if(name.length() == 0 || name.length() > MAX_AUTHOR_NAME_LENGTH)
throw new IllegalArgumentException();
this.id = id;
this.name = name;
this.publicKey = publicKey;