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