AuthInfo: Fix NullPointerException if there are no contributor agreements
The JavaScript exception is:
SEVERE: (TypeError) : Cannot read property 'iterator' of null
Class$S170: (TypeError) : Cannot read property 'iterator' of null
at Unknown.$contributorAgreements(gerrit_ui-4.js)
at Unknown.onLoad_19(gerrit_ui-4.js)
at Unknown.onAttach_0(gerrit_ui-0.js)
at Unknown.setParent(gerrit_ui-0.js)
...
Change-Id: I9de8ed23fbccf8987c871f36509f6f203a0ae73a
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -67,8 +67,11 @@ public class AuthInfo extends JavaScriptObject {
|
||||
|
||||
public final List<AgreementInfo> contributorAgreements() {
|
||||
List<AgreementInfo> agreements = new ArrayList<>();
|
||||
for (AgreementInfo a : Natives.asList(_contributorAgreements())) {
|
||||
agreements.add(a);
|
||||
JsArray<AgreementInfo> contributorAgreements = _contributorAgreements();
|
||||
if (contributorAgreements != null) {
|
||||
for (AgreementInfo a : Natives.asList(contributorAgreements)) {
|
||||
agreements.add(a);
|
||||
}
|
||||
}
|
||||
return agreements;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user