Changeset 8ed1b96


Ignore:
Timestamp:
Apr 29, 2018 8:57:47 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ab039b8
Parents:
c73b5b9
Message:

Console: Fix NPE on /configsidebar (ticket #2220)
Don't throw NPE translating null
Add note about split()
Fix form inside table

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java

    rc73b5b9 r8ed1b96  
    10071007                config = _context.getProperty(PROP_SUMMARYBAR + "default", isAdvanced() ? DEFAULT_FULL_ADVANCED : DEFAULT_FULL);
    10081008        }
     1009        if (config.length() <= 0)
     1010            return Collections.emptyList();
    10091011        return Arrays.asList(DataHelper.split(config, SS));
    10101012    }
     
    10821084        for (String section : sections) {
    10831085            int i = sections.indexOf(section);
     1086            String name = sectionNames.get(section);
     1087            if (name == null)
     1088                continue;
    10841089            buf.append("<tr><td align=\"center\"><input type=\"checkbox\" class=\"optbox\" id=\"")
    1085                .append(sectionNames.get(section))
     1090               .append(name)
    10861091               .append("\" name=\"delete_")
    10871092               .append(i)
    10881093               .append("\"></td><td align=\"left\"><label for=\"")
    1089                .append(sectionNames.get(section))
     1094               .append(name)
    10901095               .append("\">")
    1091                .append(_t(sectionNames.get(section)))
     1096               .append(_t(name))
    10921097               .append("</label></td><td align=\"right\"><input type=\"hidden\" name=\"order_")
    10931098               .append(i).append('_').append(section)
     
    11521157
    11531158        for (String s : sortedSections) {
     1159            String name = sectionNames.get(s);
     1160            if (name == null)
     1161                continue;
    11541162            buf.append("<option value=\"").append(s).append("\">")
    1155                .append(sectionNames.get(s)).append("</option>\n");
     1163               .append(name).append("</option>\n");
    11561164        }
    11571165
  • apps/routerconsole/jsp/configsidebar.jsp

    rc73b5b9 r8ed1b96  
    3131
    3232<h3 class="tabletitle"><%=intl._t("Refresh Interval")%></h3>
     33<form action="" method="POST">
    3334<table class="configtable">
    3435 <tr>
    35 <form action="" method="POST">
    3636  <td>
    3737 <input type="hidden" name="nonce" value="<%=pageNonce%>" >
     
    4343 <input type="submit" name="action" class="accept" value="<%=intl._t("Save")%>" >
    4444  </td>
    45 </form>
    4645 </tr>
    4746</table>
     47</form>
    4848
    4949<h3 class="tabletitle"><%=intl._t("Customize Summary Bar")%></h3>
  • core/java/src/net/i2p/data/DataHelper.java

    rc73b5b9 r8ed1b96  
    19511951     *  This saves about 10 microseconds (Bulldozer) on subsequent invocations.
    19521952     *
     1953     *  Note: For an input "" this returns [""], not a zero-length array.
     1954     *  This is the same behavior as String.split().
     1955     *
    19531956     *  @param s non-null
    19541957     *  @param regex non-null, don't forget to enclose multiple choices with []
     
    19651968     *  Same as s.split(regex, limit) but caches the compiled pattern for speed.
    19661969     *  This saves about 10 microseconds (Bulldozer) on subsequent invocations.
     1970     *
     1971     *  Note: For an input "" this returns [""], not a zero-length array.
     1972     *  This is the same behavior as String.split().
    19671973     *
    19681974     *  @param s non-null
  • core/java/src/net/i2p/util/Translate.java

    rc73b5b9 r8ed1b96  
    4444    /** lang in routerconsole.lang property, else current locale */
    4545    public static String getString(String key, I2PAppContext ctx, String bun) {
     46        if (key == null) {
     47            (new NullPointerException("null translation string")).printStackTrace();
     48            return "";
     49        }
    4650        String lang = getLanguage(ctx);
    4751        if (lang.equals("en"))
  • history.txt

    rc73b5b9 r8ed1b96  
     12018-04-29 zzz
     2 * Console: Fix NPE on /configsidebar (ticket #2220)
     3
     42018-04-28 zzz
     5 * i2ptunnel:
     6   - Fix startup deadlock in TCG
     7   - Initial work on SSL wizard
     8
    192018-04-27 zzz
    210  * Tunnels: Fix and consolidate allow-zero-hop logic,
  • router/java/src/net/i2p/router/RouterVersion.java

    rc73b5b9 r8ed1b96  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 7;
     21    public final static long BUILD = 8;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.