From edaa97672a861bafa7f4551e26d086287eaf1ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Besson?= Date: Fri, 17 May 2024 12:27:02 +0100 Subject: [PATCH] Add null check for image.getFormat() Under some conditions, an Image might have no associated format. This will be the case for ROMIO pixel buffer e.g. created by scripts or OMERO pyramid pixel buffer created by the PixelService for large images without resolutions. --- .../java/com/glencoesoftware/omero/zarr/ZarrPixelsService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/glencoesoftware/omero/zarr/ZarrPixelsService.java b/src/main/java/com/glencoesoftware/omero/zarr/ZarrPixelsService.java index 0792904..4a3ef1a 100644 --- a/src/main/java/com/glencoesoftware/omero/zarr/ZarrPixelsService.java +++ b/src/main/java/com/glencoesoftware/omero/zarr/ZarrPixelsService.java @@ -325,7 +325,7 @@ protected ZarrPixelBuffer createOmeNgffPixelBuffer(Pixels pixels) { String uri = getUri(image); if (uri == null) { // Quick exit if we think we're OME-NGFF but there is no URI - if ("OMEXML".equals(image.getFormat().getValue())) { + if (image.getFormat() != null && "OMEXML".equals(image.getFormat().getValue())) { throw new LockTimeout("Import in progress.", 15*1000, 0); } log.debug("No OME-NGFF root");