Gerrit#updateUiLink: Fix access to undefined property
uiSwitcherLink attribute is instantiated conditionally, when PG UI was not disabled. The invocation of setHref() method on it: uiSwitcherLink.setHref(getUiSwitcherUrl(token)); was done unconditionally. That leads to this error: (TypeError) : Cannot read property 'setHref' of undefined Bug: Issue 5929 Change-Id: I872cdf7d41ab36e03126df54bb12c9071da5543d
This commit is contained in:

committed by
David Pursehouse

parent
cdeb08b3ea
commit
fc555d7854
@@ -598,7 +598,9 @@ public class Gerrit implements EntryPoint {
|
||||
}
|
||||
|
||||
private static void updateUiLink(String token) {
|
||||
uiSwitcherLink.setHref(getUiSwitcherUrl(token));
|
||||
if (uiSwitcherLink != null) {
|
||||
uiSwitcherLink.setHref(getUiSwitcherUrl(token));
|
||||
}
|
||||
}
|
||||
|
||||
private void onModuleLoad2(HostPageData hpd) {
|
||||
|
Reference in New Issue
Block a user