Skip to content

Commit

Permalink
feedback, removed null-checks (bunq#93)
Browse files Browse the repository at this point in the history
less complexity, risk for nullpointers is the same as before
  • Loading branch information
tubbynl committed Jun 18, 2018
1 parent aa9aae0 commit 20304a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/bunq/sdk/context/UserContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public UserContext(ApiContext apiContext) {
}

private void initUser(User user) {
if (user!=null && user.getUserPerson()!=null) {
if (user.getUserPerson()!=null) {
this.userPerson = user.getUserPerson();
} else if (user!=null && user.getUserCompany()!=null) {
} else if (user.getUserCompany()!=null) {
this.userCompany = user.getUserCompany();
} else {
throw new BunqException(ERROR_UNEXPECTED_USER_INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public User getFirstUser() {
BunqResponseRaw responseRaw = getRawResponse(USER_ENDPOINT_URL_LISTING);
BunqResponse<List<User>> response = fromJsonList(User.class, responseRaw);


return response.getValue().stream().findFirst().orElse(null);
}

Expand Down

0 comments on commit 20304a2

Please sign in to comment.