diff --git a/src/main/java/io/castle/client/internal/CastleApiImpl.java b/src/main/java/io/castle/client/internal/CastleApiImpl.java index 3ffe2c8..d193a4d 100644 --- a/src/main/java/io/castle/client/internal/CastleApiImpl.java +++ b/src/main/java/io/castle/client/internal/CastleApiImpl.java @@ -336,6 +336,9 @@ public CastleResponse log(ImmutableMap 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)); }