diff --git a/src/main/java/de/bstly/board/controller/BaseController.java b/src/main/java/de/bstly/board/controller/BaseController.java index f75384b..6e6c34a 100644 --- a/src/main/java/de/bstly/board/controller/BaseController.java +++ b/src/main/java/de/bstly/board/controller/BaseController.java @@ -86,7 +86,16 @@ public class BaseController { LocalUser localUser = localUserManager.getByUsername(username); if (localUser.getSettings() != null && localUser.getSettings().containsKey("gravity")) { try { - return Double.parseDouble(localUser.getSettings().get("gravity")); + double gravity = Double.parseDouble(localUser.getSettings().get("gravity")); + if (gravity < 0) { + return 0; + } + + if (gravity > 2) { + return 2; + } + + return gravity; } catch (Exception e) { } } @@ -106,7 +115,17 @@ public class BaseController { if (localUser.getSettings() != null && localUser.getSettings().containsKey("commentDelay")) { try { - return Long.parseLong(localUser.getSettings().get("commentDelay")); + long commentDelay = Long.parseLong(localUser.getSettings().get("commentDelay")); + + if (commentDelay < 0) { + return 0; + } + + if (commentDelay > 15) { + return 15; + } + + return commentDelay; } catch (Exception e) { } }