mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-27 22:31:40 +01:00
Added null safety
This commit is contained in:
parent
4bf6c3eeab
commit
d2c754ab0c
@ -41,6 +41,8 @@ public class MixinConnectScreen_1 {
|
||||
@Redirect(method = "run", at = @At(value = "INVOKE", target = "Ljava/util/Optional;get()Ljava/lang/Object;"))
|
||||
public Object mapSocketAddress(Optional<InetSocketAddress> instance) {
|
||||
final InetSocketAddress address = instance.get();
|
||||
if (field_40415 == null) return address;
|
||||
|
||||
final ComparableProtocolVersion forcedVersion = ((IServerInfo) field_40415).viafabricplus_forcedVersion();
|
||||
if (forcedVersion != null) {
|
||||
ProtocolHack.getForcedVersions().put(address, forcedVersion);
|
||||
|
Loading…
Reference in New Issue
Block a user