Catching instances of null returned from backend
This commit is contained in:
parent
972ada9ec3
commit
359acbf385
|
@ -18,12 +18,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const r2 = await fetch(`/api/v1/server/${id}/invites`);
|
const r2 = await fetch(`/api/v1/server/${id}/invites`);
|
||||||
if (request.ok) {
|
if (r2.ok) {
|
||||||
invites = await r2.json();
|
const a = await r2.body();
|
||||||
|
if (a != "null") {
|
||||||
|
invites = await r2.json();
|
||||||
|
}
|
||||||
for (let invite in invites) {
|
for (let invite in invites) {
|
||||||
const logsReq = await fetch(`/api/v1/invite/${invites[invite].token}/log`)
|
const logsReq = await fetch(`/api/v1/invite/${invites[invite].token}/log`)
|
||||||
if (request.ok) {
|
if (logsReq.ok) {
|
||||||
invites[invite]["log"] = await logsReq.json()
|
const b = await logsReq.body();
|
||||||
|
if (b != "null") {
|
||||||
|
invites[invite]["log"] = await logsReq.json()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue