Skip to content

Commit

Permalink
add null and empty check to recover method
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiansimson committed Apr 29, 2022
1 parent 8eba4be commit aa7fad9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/io/castle/client/internal/CastleApiImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ public CastleResponse log(ImmutableMap<Object, Object> payload) {

@Override
public CastleResponse recover(String userId) {
Preconditions.checkNotNull(userId, "UserId can not be null");
Preconditions.checkArgument(!userId.isEmpty());

RestApi restApi = configuration.getRestApiFactory().buildBackend();
return restApi.put(String.format(Castle.URL_RECOVER, userId));
}
Expand Down

0 comments on commit aa7fad9

Please sign in to comment.