Skip to content
Permalink
Browse files

[FIXED JENKINS-33479] NPE caused by accessing viewGroupMixIn inside c…

…tor before it was actually set.
  • Loading branch information...
jglick committed Mar 11, 2016
1 parent 798b6a1 commit 6537ed139bd84668a9da5d9fdac37318eb1448de
Showing with 8 additions and 11 deletions.
  1. +8 −11 src/main/java/com/cloudbees/hudson/plugins/folder/AbstractFolder.java
@@ -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()) {

0 comments on commit 6537ed1

Please sign in to comment.
You can’t perform that action at this time.