Skip to content

Commit

Permalink
[FIXED JENKINS-33479] NPE caused by accessing viewGroupMixIn inside c…
Browse files Browse the repository at this point in the history
…tor before it was actually set.
  • Loading branch information
jglick committed Mar 11, 2016
1 parent 798b6a1 commit 6537ed1
Showing 1 changed file with 8 additions and 11 deletions.
Expand Up @@ -191,33 +191,30 @@ protected void init() {
if (views == null) {
views = new CopyOnWriteArrayList<View>();
}
if (views.isEmpty()) {
try {
initViews(views);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to set up the initial view", e);
}
}
if (viewsTabBar == null) {
viewsTabBar = new DefaultViewsTabBar();
}
if (primaryView == null) {
primaryView = views.get(0).getViewName();
}
viewGroupMixIn = new ViewGroupMixIn(this) {
@Override
protected List<View> views() {
return views;
}
@Override
protected String primaryView() {
return primaryView;
return primaryView == null ? views.get(0).getViewName() : primaryView;
}
@Override
protected void primaryView(String name) {
primaryView = name;
}
};
if (views.isEmpty()) {
try {
initViews(views);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to set up the initial view", e);
}
}
if (healthMetrics == null) {
List<FolderHealthMetric> metrics = new ArrayList<FolderHealthMetric>();
for (FolderHealthMetricDescriptor d : FolderHealthMetricDescriptor.all()) {
Expand Down

0 comments on commit 6537ed1

Please sign in to comment.