Wed, 25 Nov 2020 11:17:39 +0100
temporarily fixes version and component filter settings
src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java | file | annotate | diff | comparison | revisions |
--- a/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Wed Nov 25 11:13:02 2020 +0100 +++ b/src/main/java/de/uapcore/lightpit/modules/ProjectsModule.java Wed Nov 25 11:17:39 2020 +0100 @@ -95,22 +95,26 @@ // Select Version final var versionNode = pathParameters.get("version"); - if ("no-version".equals(versionNode)) { - viewModel.setVersionFilter(ProjectView.NO_VERSION); - } else if ("all-versions".equals(versionNode) || versionNode == null) { - viewModel.setVersionFilter(ProjectView.ALL_VERSIONS); - } else { - viewModel.setVersionFilter(versionDao.findByNode(project, versionNode)); + if (versionNode != null) { + if ("no-version".equals(versionNode)) { + viewModel.setVersionFilter(ProjectView.NO_VERSION); + } else if ("all-versions".equals(versionNode)) { + viewModel.setVersionFilter(ProjectView.ALL_VERSIONS); + } else { + viewModel.setVersionFilter(versionDao.findByNode(project, versionNode)); + } } // Select Component final var componentNode = pathParameters.get("component"); - if ("no-component".equals(componentNode)) { - viewModel.setComponentFilter(ProjectView.NO_COMPONENT); - } else if ("all-components".equals(componentNode) || componentNode == null) { - viewModel.setComponentFilter(ProjectView.ALL_COMPONENTS); - } else { - viewModel.setComponentFilter(componentDao.findByNode(project, componentNode)); + if (componentNode != null) { + if ("no-component".equals(componentNode)) { + viewModel.setComponentFilter(ProjectView.NO_COMPONENT); + } else if ("all-components".equals(componentNode)) { + viewModel.setComponentFilter(ProjectView.ALL_COMPONENTS); + } else { + viewModel.setComponentFilter(componentDao.findByNode(project, componentNode)); + } } }