diff --git a/src/de/steamwar/bungeecore/listeners/SubserverProtocolFixer.java b/src/de/steamwar/bungeecore/listeners/SubserverProtocolFixer.java index b87c960..927d47c 100644 --- a/src/de/steamwar/bungeecore/listeners/SubserverProtocolFixer.java +++ b/src/de/steamwar/bungeecore/listeners/SubserverProtocolFixer.java @@ -49,12 +49,18 @@ public class SubserverProtocolFixer extends BasicListener { @EventHandler public void loginEvent(LoginEvent e) { InitialHandler initialHandler = ((InitialHandler) e.getConnection()); - LoginResult.Property[] properties = initialHandler.getLoginProfile().getProperties(); - try { - String extraData = "\00" + AddressUtil.sanitizeAddress(inetSocketAddress) + "\00" + UUIDUtils.undash(initialHandler.getUniqueId().toString()); + + String extraData = "\00" + AddressUtil.sanitizeAddress(inetSocketAddress) + "\00" + UUIDUtils.undash(initialHandler.getUniqueId().toString()); + + LoginResult result = initialHandler.getLoginProfile(); + if (result != null) { + LoginResult.Property[] properties = result.getProperties(); if (properties.length > 0) { extraData += "\00" + BungeeCord.getInstance().gson.toJson(properties); } + } + + try { field.set(initialHandler, extraData); } catch (IllegalAccessException ex) { BungeeCord.getInstance().getLogger().log(Level.SEVERE, ex.getMessage(), ex);