protected void processTemplate(TemplateContext templateContext, ServletRequest request) throws RedirectException {
super.processTemplate(templateContext, request);
if (request.getMethod() == Method.POST) {
- String name = request.getServletRequest().getParameter("name");
+ String name = request.getServletRequest().getParameter("name").trim();
+ if (name.length() == 0) {
+ templateContext.set("error", "no-name-given");
+ return;
+ }
try {
Artist artist = getCore().getDataManager().createArtist(name);
throw new RedirectException("admin.edit-artist?id=" + artist.getId());