1
0
mirror of https://github.com/bitwarden/server synced 2025-12-23 03:33:35 +00:00

Add #nullable disable to platform code (#6057)

This commit is contained in:
Justin Baur
2025-07-08 10:25:59 -04:00
committed by GitHub
parent 7fb7d6fa56
commit fa0c9cb387
291 changed files with 1158 additions and 296 deletions

View File

@@ -1,4 +1,7 @@
using System.Net;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using System.Net;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json;

View File

@@ -20,17 +20,19 @@ public class I18nService : II18nService
return _localizer[key];
}
public LocalizedString GetLocalizedHtmlString(string key, params object[] args)
public LocalizedString GetLocalizedHtmlString(string key, params object?[] args)
{
#nullable disable // IStringLocalizer does actually support null args, it is annotated incorrectly: https://github.com/dotnet/aspnetcore/issues/44251
return _localizer[key, args];
#nullable enable
}
public string Translate(string key, params object[] args)
public string Translate(string key, params object?[] args)
{
return string.Format(GetLocalizedHtmlString(key).ToString(), args);
}
public string T(string key, params object[] args)
public string T(string key, params object?[] args)
{
return Translate(key, args);
}

View File

@@ -1,4 +1,7 @@
using Bit.Core.AdminConsole.Entities;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Entities.Provider;
using Bit.Core.AdminConsole.Models.Data.Provider;
using Bit.Core.AdminConsole.Repositories;

View File

@@ -1,4 +1,7 @@
using Bit.Core.Context;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using Bit.Core.Context;
using Bit.Core.Identity;
using Bit.Core.Settings;
using Bit.Core.Utilities;

View File

@@ -1,4 +1,7 @@
using System.IdentityModel.Tokens.Jwt;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Security.Cryptography.X509Certificates;
using System.Text;

View File

@@ -1,4 +1,7 @@
using System.Security.Cryptography.X509Certificates;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using System.Security.Cryptography.X509Certificates;
using Bit.Core.Platform.X509ChainCustomization;
using Bit.Core.Settings;
using Bit.Core.Utilities;

View File

@@ -1,4 +1,7 @@
using Bit.Core.Models.BitStripe;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using Bit.Core.Models.BitStripe;
using Stripe;
namespace Bit.Core.Services;

View File

@@ -1,4 +1,7 @@
using Bit.Core.AdminConsole.Entities;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Entities.Provider;
using Bit.Core.AdminConsole.Models.Business;
using Bit.Core.Billing.Constants;

View File

@@ -1,4 +1,7 @@
using System.Security.Claims;
// FIXME: Update this file to be null safe and then delete the line below
#nullable disable
using System.Security.Claims;
using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Enums;
using Bit.Core.AdminConsole.Models.Data;