From ada3664c79785fa3ffa4bda7e0d55c139f1ab303 Mon Sep 17 00:00:00 2001 From: Jorge Ortiz Date: Mon, 2 Dec 2024 15:21:26 +0100 Subject: [PATCH] MET-6262 add switch case when ColorSpace is null --- .../indexing/solr/facet/value/ImageColorSpace.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/metis-indexing/src/main/java/eu/europeana/indexing/solr/facet/value/ImageColorSpace.java b/metis-indexing/src/main/java/eu/europeana/indexing/solr/facet/value/ImageColorSpace.java index d6491fd98..176a846fe 100644 --- a/metis-indexing/src/main/java/eu/europeana/indexing/solr/facet/value/ImageColorSpace.java +++ b/metis-indexing/src/main/java/eu/europeana/indexing/solr/facet/value/ImageColorSpace.java @@ -28,11 +28,12 @@ public int getCode() { * @return The category, or null if none of the categories apply. */ public static ImageColorSpace categorizeImageColorSpace(final ColorSpace colorSpace) { - return switch (colorSpace) { - case ColorSpace.COLOR -> ImageColorSpace.COLOR; - case ColorSpace.GRAYSCALE -> ImageColorSpace.GRAYSCALE; - case ColorSpace.OTHER -> ImageColorSpace.OTHER; - }; + return switch (colorSpace) { + case null -> null; + case ColorSpace.COLOR -> ImageColorSpace.COLOR; + case ColorSpace.GRAYSCALE -> ImageColorSpace.GRAYSCALE; + case ColorSpace.OTHER -> ImageColorSpace.OTHER; + }; } /**