From fdc4de634c727ef55cc08ce8ca2f76199402ac83 Mon Sep 17 00:00:00 2001 From: fa5u5m3 Date: Mon, 25 Feb 2019 15:42:52 -0800 Subject: [PATCH] fix(serialization): preventing NPE when Customer.moipAccount is null during serialization to String(Json) --- src/main/java/br/com/moip/resource/Customer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/br/com/moip/resource/Customer.java b/src/main/java/br/com/moip/resource/Customer.java index 297972b..305fd7a 100644 --- a/src/main/java/br/com/moip/resource/Customer.java +++ b/src/main/java/br/com/moip/resource/Customer.java @@ -66,7 +66,9 @@ public FundingInstrument getFundingInstrument() { return fundingInstrument; } - public String getMoipAccountId() { return moipAccount.getId(); } + public String getMoipAccountId() { + return moipAccount != null ? moipAccount.getId() : null; + } public CustomerLinks getLinks() { return _links; }