Extra checks for crash fix
This commit is contained in:
@@ -190,7 +190,7 @@ public class NetClient implements ApplicationListener{
|
|||||||
public static void sendChatMessage(Player player, String message){
|
public static void sendChatMessage(Player player, String message){
|
||||||
|
|
||||||
//do not receive chat messages from clients that are too young or not registered
|
//do not receive chat messages from clients that are too young or not registered
|
||||||
if(net.server() && player != null && (Time.timeSinceMillis(player.con.connectTime) < 500 || !player.con.hasConnected || !player.isAdded())) return;
|
if(net.server() && player != null && player.con != null && (Time.timeSinceMillis(player.con.connectTime) < 500 || !player.con.hasConnected || !player.isAdded())) return;
|
||||||
|
|
||||||
if(message.length() > maxTextLength){
|
if(message.length() > maxTextLength){
|
||||||
throw new ValidateException(player, "Player has sent a message above the text limit.");
|
throw new ValidateException(player, "Player has sent a message above the text limit.");
|
||||||
|
|||||||
Reference in New Issue
Block a user