Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions server/src/org/apache/cloudstack/region/RegionsApiUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,12 @@ protected static UserAccount makeUserAccountAPICall(Region region, String comman
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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this return is not needed. we will fall through to other return. You can opt not to and put another log message in there as well. (no biggy)

}
} else {
return null;
}
Expand Down Expand Up @@ -304,4 +308,4 @@ private static String signRequest(String request, String key) {
}
}

}
}