Add safety check for getting data from a non-set up channel
This commit is contained in:
parent
0db0ee18ae
commit
fe91f856fe
1 changed files with 3 additions and 0 deletions
|
|
@ -23,6 +23,9 @@ const route: ServerRoute = {
|
||||||
const { word_list } = request.query;
|
const { word_list } = request.query;
|
||||||
|
|
||||||
let data = await database.getChannel(channel);
|
let data = await database.getChannel(channel);
|
||||||
|
if (data == null) {
|
||||||
|
throw boom.badRequest(`Couldn't find the requested channel's information, make sure to register it`);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
if (config.game.files[word_list] == null) {
|
if (config.game.files[word_list] == null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue