mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-22 07:28:09 -05:00
Don't allow blank server address
This commit is contained in:
parent
34fc6c2eaa
commit
1287cb2f9f
1 changed files with 4 additions and 0 deletions
|
@ -31,6 +31,10 @@ import java.net.SocketAddress;
|
|||
public class AddressUtil {
|
||||
|
||||
public static SocketAddress parse(final String serverAddress, final ProtocolVersion version) {
|
||||
if (serverAddress.isBlank()) {
|
||||
throw new IllegalArgumentException("Server address cannot be blank");
|
||||
}
|
||||
|
||||
if (serverAddress.startsWith("file:///") || serverAddress.startsWith("unix:///")) { // Unix Socket
|
||||
final String filePath = serverAddress.substring(7);
|
||||
|
||||
|
|
Loading…
Reference in a new issue