From 7a427372872580e6d4ce740e668101dbc2a1f536 Mon Sep 17 00:00:00 2001 From: AsamK Date: Wed, 27 Jul 2022 20:58:58 +0200 Subject: [PATCH] Workaround possible GraalVM issue --- src/main/java/org/asamk/signal/util/IOUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/asamk/signal/util/IOUtils.java b/src/main/java/org/asamk/signal/util/IOUtils.java index 2d4ffd8e..9e0d6c3e 100644 --- a/src/main/java/org/asamk/signal/util/IOUtils.java +++ b/src/main/java/org/asamk/signal/util/IOUtils.java @@ -121,13 +121,13 @@ public class IOUtils { return socketAddress; } - public static UnixDomainPrincipal getUnixDomainPrincipal(final SocketChannel channel) throws IOException { + public static String getUnixDomainPrincipal(final SocketChannel channel) throws IOException { UnixDomainPrincipal principal = null; try { principal = channel.getOption(ExtendedSocketOptions.SO_PEERCRED); } catch (UnsupportedOperationException | NoClassDefFoundError ignored) { } - return principal; + return principal == null ? null : principal.toString(); } public static ServerSocketChannel bindSocket(final SocketAddress address) throws IOErrorException {