From 7bc473fd247cef409d3c6f2e10b66eecf47fe404 Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Mon, 24 Mar 2003 15:41:11 +0000 Subject: [PATCH] Small fix. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1857 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/util/StringUtils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/org/jivesoftware/smack/util/StringUtils.java b/source/org/jivesoftware/smack/util/StringUtils.java index 545c04d3e..5e8dd532b 100644 --- a/source/org/jivesoftware/smack/util/StringUtils.java +++ b/source/org/jivesoftware/smack/util/StringUtils.java @@ -80,11 +80,12 @@ public class StringUtils { return null; } int atIndex = JID.indexOf("@"); - if (atIndex > 0) { - return JID.substring(0, atIndex); + if (atIndex < 0) { + return JID.substring(0); } else { - return JID.substring(0); + return JID.substring(0, atIndex); + } }