From ee15594da701301734d1a9f2f656f5b0766cb274 Mon Sep 17 00:00:00 2001 From: Bryan Aldrich Date: Wed, 4 Dec 2024 13:37:18 -0500 Subject: [PATCH] fix nullable de-reference on Created. --- .../src/main/resources/csharp/auth/TokenResponse.mustache | 2 +- .../src/Org.OpenAPITools/Client/Auth/TokenResponse.cs | 2 +- .../Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs | 2 +- .../Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs | 2 +- .../src/Org.OpenAPITools/Client/Auth/TokenResponse.cs | 2 +- .../Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs | 2 +- .../src/Org.OpenAPITools/Client/Auth/TokenResponse.cs | 2 +- .../Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp/auth/TokenResponse.mustache b/modules/openapi-generator/src/main/resources/csharp/auth/TokenResponse.mustache index becd82d87a1..7a72e04c12c 100644 --- a/modules/openapi-generator/src/main/resources/csharp/auth/TokenResponse.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/auth/TokenResponse.mustache @@ -19,6 +19,6 @@ namespace {{packageName}}.Client.Auth [JsonProperty("refresh_token")] public string{{nrt?}} RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index ab1cf58090d..5ff4349979f 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -27,6 +27,6 @@ namespace Org.OpenAPITools.Client.Auth [JsonProperty("refresh_token")] public string RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index d3703f73dd7..95e03c36e10 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -27,6 +27,6 @@ namespace Org.OpenAPITools.Client.Auth [JsonProperty("refresh_token")] public string RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index d3703f73dd7..95e03c36e10 100644 --- a/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net4.8/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -27,6 +27,6 @@ namespace Org.OpenAPITools.Client.Auth [JsonProperty("refresh_token")] public string RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index 9b9fc94bbf8..da4f4499b1c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net7/EnumMappings/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -27,6 +27,6 @@ namespace Org.OpenAPITools.Client.Auth [JsonProperty("refresh_token")] public string? RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index 9b9fc94bbf8..da4f4499b1c 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -27,6 +27,6 @@ namespace Org.OpenAPITools.Client.Auth [JsonProperty("refresh_token")] public string? RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index d3703f73dd7..95e03c36e10 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -27,6 +27,6 @@ namespace Org.OpenAPITools.Client.Auth [JsonProperty("refresh_token")] public string RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs index d3703f73dd7..95e03c36e10 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Auth/TokenResponse.cs @@ -27,6 +27,6 @@ namespace Org.OpenAPITools.Client.Auth [JsonProperty("refresh_token")] public string RefreshToken { get; set; } - public DateTime? ExpiresAt => ExpiresIn == null ? null : Created.AddSeconds(ExpiresIn.Value); + public DateTime? ExpiresAt => ExpiresIn == null ? null : Created?.AddSeconds(ExpiresIn.Value); } } \ No newline at end of file