fix tagline null sql violation

This commit is contained in:
Jake Potrebic 2020-08-07 08:23:03 -07:00
parent 9fc8dcaa88
commit 9118181840
No known key found for this signature in database
GPG Key ID: 66CC830CB7028AEC

View File

@ -15,6 +15,7 @@ import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView; import org.springframework.web.servlet.view.RedirectView;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
@ -201,7 +202,7 @@ public class UsersController extends HangarController {
return new ModelAndView("redirect:" + routeHelper.getRouteUrl("users.showProjects", user)); return new ModelAndView("redirect:" + routeHelper.getRouteUrl("users.showProjects", user));
} }
UsersTable usersTable = userDao.get().getByName(user); UsersTable usersTable = userDao.get().getByName(user);
userActionLogService.user(request, LoggedActionType.USER_TAGLINE_CHANGED.with(LoggedActionType.UserContext.of(usersTable.getId())), tagline, usersTable.getTagline()); userActionLogService.user(request, LoggedActionType.USER_TAGLINE_CHANGED.with(LoggedActionType.UserContext.of(usersTable.getId())), tagline, Optional.ofNullable(usersTable.getTagline()).orElse(""));
usersTable.setTagline(tagline); usersTable.setTagline(tagline);
userDao.get().update(usersTable); userDao.get().update(usersTable);
return new ModelAndView("redirect:" + routeHelper.getRouteUrl("users.showProjects", user)); return new ModelAndView("redirect:" + routeHelper.getRouteUrl("users.showProjects", user));