Commit 1e666de8 by Tuomas Riihimäki

Check for null. Nullpointers can be safely avoided an they clutter the log

1 parent d7548936
......@@ -272,15 +272,18 @@ public class IncomingView extends GenericCDIView {
* @return Card filing info String or empty string.
*/
public String getCardFiling() {
String ret = "";
try {
PrintedCard card = cardBean.checkPrintedCard(userview.getSelectedUser());
JsonObject cardMeta = card.getMeta();
JsonObject cardFilingObject = cardMeta.getJsonObject("card-filing");
return cardFilingObject.getString("cardplace");
if (card != null) {
JsonObject cardMeta = card.getMeta();
JsonObject cardFilingObject = cardMeta.getJsonObject("card-filing");
ret = cardFilingObject.getString("cardplace");
}
} catch (Exception e) {
logger.warn("Could not get card filing info", e);
}
return "";
return ret;
}
public String printCard() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!