Error handling

master
masterhc 1 year ago
parent d9d2cee1ab
commit 3a933ef7b0

@ -25,7 +25,7 @@ exports.dashboard = (bot)=>
username:'placeholder',
avatar:'',
}
if(!req.headers.cookie) return res.render('dashboard.ejs', {user:userPlaceholder, guilds:{}});
if(!req.headers.cookie) return res.render('dashboard.ejs', {user:userPlaceholder, guilds:[{}]});
const connector = new DiscordAPI(req.headers.cookie, bot);
const user = await connector.getUser();
const guilds = await connector.getGuildsFull();

@ -1,5 +1,7 @@
<div id="Guilds" >
<% guilds.forEach(guild => {%>
<%- include('guildCard.ejs', {guild}) %>
<% }); %>
<% if(guilds.length>0){%>
<% guilds.forEach(guild => {%>
<%- include('guildCard.ejs', {guild}) %>
<% }); %>
<% } %>
</div>
Loading…
Cancel
Save