"Report Bug" URL can never be null
The config provider will always provide a value. Either the value given by the user in gerrit.config, or the default value. Change-Id: I9b7107857c79f939ed5315e52610277b05ef7d67
This commit is contained in:
@@ -463,15 +463,14 @@ public class Gerrit implements EntryPoint {
|
|||||||
btmmenu.add(new InlineLabel(C.keyHelp()));
|
btmmenu.add(new InlineLabel(C.keyHelp()));
|
||||||
btmmenu.add(new InlineLabel(" | "));
|
btmmenu.add(new InlineLabel(" | "));
|
||||||
btmmenu.add(new InlineHTML(M.poweredBy(vs)));
|
btmmenu.add(new InlineHTML(M.poweredBy(vs)));
|
||||||
if (getConfig().getReportBugUrl() != null) {
|
|
||||||
Anchor a = new Anchor(
|
Anchor a = new Anchor(
|
||||||
C.reportBug(),
|
C.reportBug(),
|
||||||
getConfig().getReportBugUrl());
|
getConfig().getReportBugUrl());
|
||||||
a.setTarget("_blank");
|
a.setTarget("_blank");
|
||||||
a.setStyleName("");
|
a.setStyleName("");
|
||||||
btmmenu.add(new InlineLabel(" | "));
|
btmmenu.add(new InlineLabel(" | "));
|
||||||
btmmenu.add(a);
|
btmmenu.add(a);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onModuleLoad2(HostPageData hpd) {
|
private void onModuleLoad2(HostPageData hpd) {
|
||||||
|
@@ -129,12 +129,9 @@ class GerritConfigProvider implements Provider<GerritConfig> {
|
|||||||
config.setLargeChangeSize(cfg.getInt("change", "largeChange", 500));
|
config.setLargeChangeSize(cfg.getInt("change", "largeChange", 500));
|
||||||
config.setNewFeatures(cfg.getBoolean("gerrit", "enableNewFeatures", true));
|
config.setNewFeatures(cfg.getBoolean("gerrit", "enableNewFeatures", true));
|
||||||
|
|
||||||
config.setReportBugUrl(cfg.getString("gerrit", null, "reportBugUrl"));
|
final String reportBugUrl = cfg.getString("gerrit", null, "reportBugUrl");
|
||||||
if (config.getReportBugUrl() == null) {
|
config.setReportBugUrl(reportBugUrl != null ?
|
||||||
config.setReportBugUrl("http://code.google.com/p/gerrit/issues/list");
|
reportBugUrl : "http://code.google.com/p/gerrit/issues/list");
|
||||||
} else if (config.getReportBugUrl().isEmpty()) {
|
|
||||||
config.setReportBugUrl(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
config.setGitBasicAuth(authConfig.isGitBasicAuth());
|
config.setGitBasicAuth(authConfig.isGitBasicAuth());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user