From 6b1c077d097227cc3aa81126f1a0a6dde84e59ca Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 5 May 2026 10:52:49 -0700 Subject: [PATCH 1/2] [bfops/argument-null-exception]: Fix ArgumentNullException --- crates/bindings-csharp/BSATN.Runtime/Builtins.cs | 2 ++ crates/bindings-csharp/BSATN.Runtime/QueryBuilder.cs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/crates/bindings-csharp/BSATN.Runtime/Builtins.cs b/crates/bindings-csharp/BSATN.Runtime/Builtins.cs index ec2331aa6a8..b324c1d56d7 100644 --- a/crates/bindings-csharp/BSATN.Runtime/Builtins.cs +++ b/crates/bindings-csharp/BSATN.Runtime/Builtins.cs @@ -1,6 +1,8 @@ namespace SpacetimeDB; +#if !NET5_0_OR_GREATER using System.Diagnostics; +#endif using System.Runtime.InteropServices; using SpacetimeDB.BSATN; diff --git a/crates/bindings-csharp/BSATN.Runtime/QueryBuilder.cs b/crates/bindings-csharp/BSATN.Runtime/QueryBuilder.cs index 45f481847b4..db16bd56cd7 100644 --- a/crates/bindings-csharp/BSATN.Runtime/QueryBuilder.cs +++ b/crates/bindings-csharp/BSATN.Runtime/QueryBuilder.cs @@ -877,10 +877,14 @@ public static string FormatStringLiteral(ReadOnlySpan value) => public static string FormatHexLiteral(string hex) { +#if NET6_0_OR_GREATER + ArgumentNullException.ThrowIfNull(hex); +#else if (hex is null) { throw new ArgumentNullException(nameof(hex)); } +#endif var s = hex; if (s.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) From a46ce8d0f6d4433f2aee85677f27ddfc275a6e03 Mon Sep 17 00:00:00 2001 From: Zeke Foppa Date: Tue, 5 May 2026 11:04:47 -0700 Subject: [PATCH 2/2] [bfops/argument-null-exception]: format --- crates/bindings-csharp/BSATN.Runtime/Builtins.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bindings-csharp/BSATN.Runtime/Builtins.cs b/crates/bindings-csharp/BSATN.Runtime/Builtins.cs index b324c1d56d7..e204985b54a 100644 --- a/crates/bindings-csharp/BSATN.Runtime/Builtins.cs +++ b/crates/bindings-csharp/BSATN.Runtime/Builtins.cs @@ -1,10 +1,10 @@ namespace SpacetimeDB; +using System.Runtime.InteropServices; +using SpacetimeDB.BSATN; #if !NET5_0_OR_GREATER using System.Diagnostics; #endif -using System.Runtime.InteropServices; -using SpacetimeDB.BSATN; internal static class Util {