From dcf966b2c53e70fc6d6ac495f087e0b603aaa601 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Thu, 26 Jun 2025 10:26:59 +0900 Subject: [PATCH] Fix the null check for schema should occur before accessing schema.PrimaryKey --- WelsonJS.Toolkit/WelsonJS.Esent/EsentDatabase.cs | 4 ++-- WelsonJS.Toolkit/WelsonJS.Esent/README.md | 2 +- WelsonJS.Toolkit/WelsonJS.Esent/assets/docs/README.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WelsonJS.Toolkit/WelsonJS.Esent/EsentDatabase.cs b/WelsonJS.Toolkit/WelsonJS.Esent/EsentDatabase.cs index ef0a71e..5c04948 100644 --- a/WelsonJS.Toolkit/WelsonJS.Esent/EsentDatabase.cs +++ b/WelsonJS.Toolkit/WelsonJS.Esent/EsentDatabase.cs @@ -36,11 +36,11 @@ namespace WelsonJS.Esent { _logger = logger ?? new TraceLogger(); - _primaryKey = schema.PrimaryKey; - if (schema == null) throw new ArgumentNullException(nameof(schema)); + _primaryKey = schema.PrimaryKey; + if (_primaryKey == null) throw new ArgumentNullException(); diff --git a/WelsonJS.Toolkit/WelsonJS.Esent/README.md b/WelsonJS.Toolkit/WelsonJS.Esent/README.md index 38d3a7d..e3327d3 100644 --- a/WelsonJS.Toolkit/WelsonJS.Esent/README.md +++ b/WelsonJS.Toolkit/WelsonJS.Esent/README.md @@ -11,7 +11,7 @@ For more details, refer to the [WelsonJS Documentation](https://catswords-oss.rd ```csharp using WelsonJS.Esent; -// connect the database to manage an instances +// connect the database to manage instances Schema schema = new Schema("Instances", new List { new Column("InstanceId", typeof(string), 255), diff --git a/WelsonJS.Toolkit/WelsonJS.Esent/assets/docs/README.md b/WelsonJS.Toolkit/WelsonJS.Esent/assets/docs/README.md index 38d3a7d..e3327d3 100644 --- a/WelsonJS.Toolkit/WelsonJS.Esent/assets/docs/README.md +++ b/WelsonJS.Toolkit/WelsonJS.Esent/assets/docs/README.md @@ -11,7 +11,7 @@ For more details, refer to the [WelsonJS Documentation](https://catswords-oss.rd ```csharp using WelsonJS.Esent; -// connect the database to manage an instances +// connect the database to manage instances Schema schema = new Schema("Instances", new List { new Column("InstanceId", typeof(string), 255),