Skip to content

Commit c852fc3

Browse files
committed
Fix: SerializerSettings could reach be accessed in a state where ClientOptions were not defined
1 parent 93ba347 commit c852fc3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Postgrest/Client.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public JsonSerializerSettings SerializerSettings
7070
{
7171
get
7272
{
73+
if (options == null)
74+
options = new ClientOptions();
75+
7376
return new JsonSerializerSettings
7477
{
7578
ContractResolver = new CustomContractResolver(),

Postgrest/ClientOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Postgrest
88
/// </summary>
99
public class ClientOptions
1010
{
11-
public string Schema { get; set; }
11+
public string Schema { get; set; } = "public";
1212
public System.Globalization.DateTimeStyles DateTimeStyles = System.Globalization.DateTimeStyles.AdjustToUniversal;
1313
public string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFK";
1414
public Dictionary<string, string> Headers { get; set; } = new Dictionary<string, string>();

0 commit comments

Comments
 (0)