Use `Preconditions.checkNotNull` in FirebaseFunctions.
@@ -194,9 +194,7 @@ public class FirebaseFunctions {
* @param origin The origin of the local emulator, such as "http://10.0.2.2:5005".
*/
public void useFunctionsEmulator(@NonNull String origin) {
- if (origin == null) {
- throw new IllegalArgumentException("origin cannot be null");
- }
+ Preconditions.checkNotNull(origin, "origin cannot be null");
urlFormat = origin + "/%2$s/%1$s/%3$s";
}
@@ -230,10 +228,11 @@ public class FirebaseFunctions {
* @return A Task that will be completed when the request is complete.
*/
private Task<HttpsCallableResult> call(
- String name, @Nullable Object data, HttpsCallableContext context, HttpsCallOptions options) {
- if (name == null) {
- throw new IllegalArgumentException("name cannot be null");
- }
+ @NonNull String name,
+ @Nullable Object data,
+ HttpsCallableContext context,
+ HttpsCallOptions options) {
+ Preconditions.checkNotNull(name, "name cannot be null");
URL url = getURL(name);
Map<String, Object> body = new HashMap<>();
