Skip to content

Commit

Permalink
Fix NullPointerException when MOTD is null
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberedCake committed Jul 11, 2022
1 parent e02ded8 commit b3f18a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private ServerPing handlePing(PendingConnection address, ServerPing ping) {

// MOTD
MOTD motd = (serverListPingEvent.getMOTD() == null ? MOTD.builder("default_temp").build() : serverListPingEvent.getMOTD());
if(motd == null) motd = MOTD.builder("_default").build();
ping.setDescriptionComponent(UChat.bComponent(motd.getFormattedMOTD()));
try {
Favicon image = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private void handlePing(InetAddress address, WrappedServerPing ping) {

// MOTD
MOTD motd = serverListPingEvent.getMOTD();
if(motd == null) motd = MOTD.builder("_default").build();
ping.setMotD(motd.getFormattedMOTD());
WrappedServerPing.CompressedImage image = null;
switch(motd.getMOTDIconType()) {
Expand Down

0 comments on commit b3f18a1

Please sign in to comment.