File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
force-app/main/default/classes Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1494,7 +1494,7 @@ public virtual inherited sharing class SOQL implements Queryable {
14941494 }
14951495
14961496 private String formattedString (String value ) {
1497- return value ?? value .trim ();
1497+ return value ?? value ? .trim ();
14981498 }
14991499
15001500 public Filter isIn (Iterable <Object > iterable ) {
Original file line number Diff line number Diff line change @@ -1075,6 +1075,20 @@ private class SOQL_Test {
10751075 Assert .areEqual (' %Test%' , binding .get (' v1' ));
10761076 }
10771077
1078+ @IsTest
1079+ static void containsNull () {
1080+ // Test
1081+ SOQL builder = SOQL .of (Account .SObjectType )
1082+ .whereAre (SOQL .Filter .with (Account .Name ).contains (null ));
1083+
1084+ // Verify
1085+ String soql = builder .toString ();
1086+ Assert .areEqual (' SELECT Id FROM Account WHERE Name LIKE :v1' , soql );
1087+
1088+ Map <String , Object > binding = builder .binding ();
1089+ Assert .areEqual (' %null%' , binding .get (' v1' ));
1090+ }
1091+
10781092 @IsTest
10791093 static void notContains () {
10801094 // Test
You can’t perform that action at this time.
0 commit comments