From 377167132faf395b936893708926bd6efa26f4a8 Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 25 May 2022 09:16:25 +0200 Subject: [PATCH] fixed exam name error --- .../ch/ethz/seb/sebserver/gui/service/ResourceService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java b/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java index 420b5c42..8dbc427f 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/service/ResourceService.java @@ -684,6 +684,8 @@ public class ResourceService { .call() .getOr(Collections.emptyList()) .stream() + .filter(entityName -> StringUtils.isNotBlank(entityName.name) + && StringUtils.isNotBlank(entityName.modelId)) .map(entityName -> new Tuple<>(entityName.modelId, entityName.name)) .sorted(RESOURCE_COMPARATOR) .collect(Collectors.toList()); @@ -697,7 +699,7 @@ public class ResourceService { .call() .getOr(Collections.emptyList()) .stream() - .filter(k -> StringUtils.isNotBlank(k.modelId)) + .filter(k -> StringUtils.isNotBlank(k.name) && StringUtils.isNotBlank(k.modelId)) .collect(Collectors.toMap( k -> Long.valueOf(k.modelId), k -> k.name));