fix
This commit is contained in:
parent
3c68bbff1a
commit
45a62b9d54
@ -55,26 +55,16 @@ public class BaseController {
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the local user.
|
||||
*
|
||||
* @return the local user
|
||||
*/
|
||||
protected LocalUser getLocalUser() {
|
||||
return localUserManager.getByAuth(SecurityContextHolder.getContext().getAuthentication());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the gravity.
|
||||
*
|
||||
* @return the gravity
|
||||
*/
|
||||
protected double getGravity() {
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (auth != null && auth.isAuthenticated()) {
|
||||
LocalUser localUser = localUserManager.getByAuth(auth);
|
||||
if (localUser != null && localUser.getSettings() != null
|
||||
&& localUser.getSettings().containsKey("gravity")) {
|
||||
String username = getCurrentUsername();
|
||||
if (username != null) {
|
||||
LocalUser localUser = localUserManager.getByUsername(username);
|
||||
if (localUser.getSettings() != null && localUser.getSettings().containsKey("gravity")) {
|
||||
try {
|
||||
return Double.parseDouble(localUser.getSettings().get("gravity"));
|
||||
} catch (Exception e) {
|
||||
|
Loading…
Reference in New Issue
Block a user