diff --git a/java/com/turbovnc/rfb/Hostname.java b/java/com/turbovnc/rfb/Hostname.java index 7d6d3acff..715decc83 100644 --- a/java/com/turbovnc/rfb/Hostname.java +++ b/java/com/turbovnc/rfb/Hostname.java @@ -76,11 +76,8 @@ public static String getSSHUser(String vncServerName) { int atPos = vncServerName.lastIndexOf('@'); String sshUser = null; - if (atPos >= 0) { - sshUser = vncServerName.substring(0, atPos); - if (sshUser.length() > 0) - return sshUser; - } + if (atPos > 0) + return vncServerName.substring(0, atPos); return null; }