Skip to content

Commit 29da75d

Browse files
MiloszSobczykcopybara-github
authored andcommitted
refactor: add precondition null check to SchemaUtils
PiperOrigin-RevId: 889790941
1 parent 5f34d59 commit 29da75d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

core/src/main/java/com/google/adk/SchemaUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.adk;
1818

1919
import com.fasterxml.jackson.core.JsonProcessingException;
20+
import com.google.common.base.Preconditions;
2021
import com.google.genai.types.Schema;
2122
import com.google.genai.types.Type;
2223
import java.util.HashMap;
@@ -87,6 +88,7 @@ private static Boolean matchType(Object value, Schema schema, Boolean isInput) {
8788
* @throws IllegalArgumentException If the map does not match the schema.
8889
*/
8990
public static void validateMapOnSchema(Map<String, Object> args, Schema schema, Boolean isInput) {
91+
Preconditions.checkNotNull(isInput, "IsInput cannot be null");
9092
Map<String, Schema> properties = schema.properties().get();
9193
for (Entry<String, Object> arg : args.entrySet()) {
9294
// Check if the argument is in the schema.

0 commit comments

Comments
 (0)