Changeset 8ed1b96 for apps


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

Location:
apps/routerconsole
Files:
2 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>
Note: See TracChangeset for help on using the changeset viewer.