From 43cf96285f01fe29ffd26a886f336b6690001a8c Mon Sep 17 00:00:00 2001 From: Jorge Ortiz Date: Mon, 2 Dec 2024 15:28:53 +0100 Subject: [PATCH] MET-6262 add switch case when ColorSpace is null (#705) --- .../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; + }; } /**