mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-25 14:37:02 +01:00
Error instead of crashing when no text channels present
This commit is contained in:
parent
a3e58ac43e
commit
856dd08167
@ -591,6 +591,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (typeof curr_default_channel == "object") {
|
if (typeof curr_default_channel == "object") {
|
||||||
|
if (curr_default_channel == null) {
|
||||||
|
$("#messagebox").prop('disabled', true);
|
||||||
|
$("#messagebox").prop('placeholder', "NO TEXT CHANNELS");
|
||||||
|
Materialize.toast("You find yourself in a strange place. You don't have access to any text channels, or there are none in this server.", 20000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
selected_channel = curr_default_channel.channel.id;
|
selected_channel = curr_default_channel.channel.id;
|
||||||
}
|
}
|
||||||
var this_channel = guild_channels[selected_channel];
|
var this_channel = guild_channels[selected_channel];
|
||||||
@ -1246,6 +1252,9 @@
|
|||||||
var channel_id = selected_channel;
|
var channel_id = selected_channel;
|
||||||
var fet;
|
var fet;
|
||||||
var jumpscroll;
|
var jumpscroll;
|
||||||
|
if (channel_id == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$("#message-spinner").fadeIn();
|
$("#message-spinner").fadeIn();
|
||||||
if (last_message_id == null) {
|
if (last_message_id == null) {
|
||||||
$("#chatcontent").empty();
|
$("#chatcontent").empty();
|
||||||
|
Loading…
Reference in New Issue
Block a user