未验证 提交 8bc435f3 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #4348 from pilou-/handle_empty_views

[JENKINS-60092] getPrimaryView: return null if no view is defined
......@@ -163,12 +163,14 @@ public abstract class ViewGroupMixIn {
}
/**
* Returns the primary {@link View} that renders the top-page of Hudson.
* Returns the primary {@link View} that renders the top-page of Hudson or
* {@code null} if there is no primary one defined.
*/
@Exported
@CheckForNull
public View getPrimaryView() {
View v = getView(primaryView());
if(v==null) // fallback
if(v==null && !views().isEmpty()) // fallback
v = views().get(0);
return v;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册