diff --git a/server/src/org/apache/cloudstack/region/RegionsApiUtil.java b/server/src/org/apache/cloudstack/region/RegionsApiUtil.java index 92c5ed4e17e..7fbcfa0795e 100644 --- a/server/src/org/apache/cloudstack/region/RegionsApiUtil.java +++ b/server/src/org/apache/cloudstack/region/RegionsApiUtil.java @@ -186,8 +186,12 @@ public class RegionsApiUtil { XStream xstream = new XStream(new DomDriver()); xstream.alias("useraccount", UserAccountVO.class); xstream.aliasField("id", UserAccountVO.class, "uuid"); - ObjectInputStream in = xstream.createObjectInputStream(is); - return (UserAccountVO)in.readObject(); + try(ObjectInputStream in = xstream.createObjectInputStream(is);) { + return (UserAccountVO)in.readObject(); + } catch (IOException e) { + s_logger.error(e.getMessage()); + return null; + } } else { return null; } @@ -304,4 +308,4 @@ public class RegionsApiUtil { } } -} \ No newline at end of file +}