diff --git a/src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java b/src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java index ba1d7902..57ace031 100644 --- a/src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java +++ b/src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java @@ -50,8 +50,8 @@ Folder d; if (context instanceof Folder) { d = ((Folder) context); - } else if (context instanceof View && ((View) context).getOwnerItemGroup() instanceof Folder) { - d = (Folder) ((View) context).getOwnerItemGroup(); + } else if (context instanceof View && ((View) context).getOwner().getItemGroup() instanceof Folder) { + d = (Folder) ((View) context).getOwner().getItemGroup(); } else { return true; }