diff --git a/apis/Google.Cloud.Datastore.V1/Google.Cloud.Datastore.V1/FilterPartial.cs b/apis/Google.Cloud.Datastore.V1/Google.Cloud.Datastore.V1/FilterPartial.cs index 006b79b54c6b..89f1d0495b84 100644 --- a/apis/Google.Cloud.Datastore.V1/Google.Cloud.Datastore.V1/FilterPartial.cs +++ b/apis/Google.Cloud.Datastore.V1/Google.Cloud.Datastore.V1/FilterPartial.cs @@ -76,19 +76,25 @@ public static Filter And(IEnumerable filters) /// Creates a filter to check that the specified property is in a given array of values. /// /// The name of the property. Must not be null. - /// The array of values to compare against. + /// The array of values to compare against. Must not be null. /// The newly created filter. - public static Filter In(string value, ArrayValue collection) => - Property(value, collection, Operator.In); + public static Filter In(string value, ArrayValue collection) + { + GaxPreconditions.CheckNotNull(collection, nameof(collection)); + return Property(value, collection, Operator.In); + } /// /// Creates a filter to check that the specified property is not in a given array of values. /// /// The name of the property. Must not be null. - /// The array of values to compare against. + /// The array of values to compare against. Must not be null. /// The newly created filter. - public static Filter NotIn(string value, ArrayValue collection) => - Property(value, collection, Operator.NotIn); + public static Filter NotIn(string value, ArrayValue collection) + { + GaxPreconditions.CheckNotNull(collection, nameof(collection)); + return Property(value, collection, Operator.NotIn); + } /// /// Creates a filter to check that the specified property is less than a given value.