Kaynağa Gözat

Rename Bits -> bits

If we have a 0-length string just ignore it.
Fixes issue 2942

Change-Id: I963aab86ff426fed0fa22fdbd1b3dce36818106a
Reviewed-on: http://gerrit.dmdirc.com/88
Reviewed-by: Chris Smith <chris@dmdirc.com>
Tested-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Shane Mc Cormack 14 yıl önce
ebeveyn
işleme
f0a697dcff
1 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 5
    4
      src/com/dmdirc/parser/irc/Process004005.java

+ 5
- 4
src/com/dmdirc/parser/irc/Process004005.java Dosyayı Görüntüle

@@ -65,10 +65,11 @@ public class Process004005 extends IRCProcessor {
65 65
         } else if (sParam.equals("005")) {
66 66
             // 005
67 67
             for (int i = 3; i < token.length ; i++) {
68
-                String[] Bits = token[i].split("=",2);
69
-                final boolean isNegation = (Bits[0].charAt(0) == '-');
70
-                final String sKey = (isNegation) ? Bits[0].substring(1).toUpperCase() : Bits[0].toUpperCase();
71
-                final String sValue = (Bits.length == 2) ? Bits[1] : "";
68
+                String[] bits = token[i].split("=",2);
69
+                if (bits[0].isEmpty()) { continue; }
70
+                final boolean isNegation = (bits[0].charAt(0) == '-');
71
+                final String sKey = (isNegation) ? bits[0].substring(1).toUpperCase() : bits[0].toUpperCase();
72
+                final String sValue = (bits.length == 2) ? bits[1] : "";
72 73
                 callDebugInfo(IRCParser.DEBUG_INFO, "%s => %s",sKey,sValue);
73 74
                 if (isNegation) {
74 75
                     myParser.h005Info.remove(sKey);

Loading…
İptal
Kaydet