From c4f2e7ccdc5c4a21b5f33e2ecd77757fb6f8638b Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Wed, 21 Dec 2011 10:21:19 +0000
Subject: [PATCH] fix integration tests

SVN: 24072
---
 .../screening/shared/imaging/HCSDatasetLoader.java       | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/HCSDatasetLoader.java b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/HCSDatasetLoader.java
index 0dcd4e1578f..17b351c5e7d 100644
--- a/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/HCSDatasetLoader.java
+++ b/screening/source/java/ch/systemsx/cisd/openbis/plugin/screening/shared/imaging/HCSDatasetLoader.java
@@ -221,8 +221,8 @@ public class HCSDatasetLoader implements IImageDatasetLoader
             ImageSetMetaData metaData = new ImageSetMetaData();
             metaData.setId(zoomLevel.getId());
             metaData.setOriginal(zoomLevel.getIsOriginal());
-            metaData.setWidth(zoomLevel.getWidth());
-            metaData.setHeight(zoomLevel.getHeight());
+            metaData.setWidth(mapNullTo0(zoomLevel.getWidth()));
+            metaData.setHeight(mapNullTo0(zoomLevel.getHeight()));
             metaData.setColorDepth(zoomLevel.getColorDepth());
             metaData.setFileType(zoomLevel.getFileType());
             result.add(metaData);
@@ -230,6 +230,11 @@ public class HCSDatasetLoader implements IImageDatasetLoader
         return result;
     }
     
+    private int mapNullTo0(Integer n)
+    {
+        return n == null ? 0 : n;
+    }
+    
     private List<InternalImageChannel> convertChannels()
     {
         List<InternalImageChannel> convertedChannels = new ArrayList<InternalImageChannel>();
-- 
GitLab