Skip to content

Commit

Permalink
don't allow an empty type in the mapper service
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Aug 13, 2012
1 parent bdea0e2 commit ad0e916
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -191,6 +191,9 @@ public void add(String type, String mappingSource) {
// instances of field mappers to properly remove existing doc mapper
private void add(DocumentMapper mapper) {
synchronized (mutex) {
if (mapper.type().length() == 0) {
throw new InvalidTypeNameException("mapping type name is empty");
}
if (mapper.type().charAt(0) == '_') {
throw new InvalidTypeNameException("mapping type name [" + mapper.type() + "] can't start with '_'");
}
Expand Down

0 comments on commit ad0e916

Please sign in to comment.