Correct internal error when guild is not set on rank page
This commit is contained in:
parent
4e9728cbd3
commit
c1cc670906
@ -157,9 +157,14 @@ public class GeneralWebView {
|
|||||||
model.addAttribute("redirect_url", System.getenv("OAUTH_URL"));
|
model.addAttribute("redirect_url", System.getenv("OAUTH_URL"));
|
||||||
try {
|
try {
|
||||||
UserEntity userEntity = userUtils.getUserWithApiToken(userRepository, token);
|
UserEntity userEntity = userUtils.getUserWithApiToken(userRepository, token);
|
||||||
|
GuildStatsPack stack;
|
||||||
|
if(!cookieGuildId.equals("")){
|
||||||
|
stack = UserStatsUtils.getINSTANCE().getStatPack(userEntity, cookieGuildId);
|
||||||
addGuildAndRedirect(model, cookieGuildId);
|
addGuildAndRedirect(model, cookieGuildId);
|
||||||
|
|
||||||
GuildStatsPack stack = UserStatsUtils.getINSTANCE().getStatPack(userEntity, cookieGuildId);
|
}
|
||||||
|
else
|
||||||
|
stack = null;
|
||||||
model.addAttribute("stack", stack);
|
model.addAttribute("stack", stack);
|
||||||
return CheckPage.getPageIfReady("rank");
|
return CheckPage.getPageIfReady("rank");
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
<main>
|
<main>
|
||||||
<!--/*@thymesVar id="stack" type="net.Broken.Tools.UserManager.Stats.GuildStatsPack"*/-->
|
<!--/*@thymesVar id="stack" type="net.Broken.Tools.UserManager.Stats.GuildStatsPack"*/-->
|
||||||
|
<th:block th:if="${stack != null}">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="card-panel col l6 offset-l3 m10 offset-m1 s10 offset-s1 grey darken-4 white-text">
|
<div class="card-panel col l6 offset-l3 m10 offset-m1 s10 offset-s1 grey darken-4 white-text">
|
||||||
<div class="row" style="margin-bottom: 0">
|
<div class="row" style="margin-bottom: 0">
|
||||||
@ -88,7 +89,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<h4 style="font-weight: bold; margin: 0"><span th:text="${stack.selfStats.total}"
|
<h4 style="font-weight: bold; margin: 0"><span th:text="${stack.selfStats.total}"
|
||||||
th:remove="tag"></span> <span>Xp</span>
|
th:remove="tag"></span>
|
||||||
|
<span>Xp</span>
|
||||||
</h4>
|
</h4>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -133,7 +135,8 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<h4 style="font-weight: bold; margin: 0"><span th:text="${stack.selfStats.messageCount}"
|
<h4 style="font-weight: bold; margin: 0"><span
|
||||||
|
th:text="${stack.selfStats.messageCount}"
|
||||||
th:remove="tag"></span> <span>msg</span>
|
th:remove="tag"></span> <span>msg</span>
|
||||||
</h4>
|
</h4>
|
||||||
</td>
|
</td>
|
||||||
@ -167,7 +170,7 @@
|
|||||||
<th:block th:each="stat : ${stack.ranking}">
|
<th:block th:each="stat : ${stack.ranking}">
|
||||||
<tr>
|
<tr>
|
||||||
<td th:text="${stat.rank}"></td>
|
<td th:text="${stat.rank}"></td>
|
||||||
<td><img th:src="${stat.avatarUrl}" class="circle" style="max-height: 50px"/> </td>
|
<td><img th:src="${stat.avatarUrl}" class="circle" style="max-height: 50px"/></td>
|
||||||
<td th:text="${stat.userName}"></td>
|
<td th:text="${stat.userName}"></td>
|
||||||
<td> <span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(0)}"
|
<td> <span th:text="${T(net.Broken.Tools.TimeConvertor).sToTime(stat.voiceTime).get(0)}"
|
||||||
th:remove="tag"></span> <span>H</span>
|
th:remove="tag"></span> <span>H</span>
|
||||||
@ -188,6 +191,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
</th:block>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user