mirror of
https://github.com/bitwarden/server
synced 2025-12-23 19:53:40 +00:00
Changed all C# control flow block statements to include space between keyword and open paren
This commit is contained in:
@@ -11,39 +11,39 @@ namespace Bit.Core.Utilities
|
||||
internal static async Task<string> AdjustStorageAsync(IPaymentService paymentService, IStorableSubscriber storableSubscriber,
|
||||
short storageAdjustmentGb, string storagePlanId)
|
||||
{
|
||||
if(storableSubscriber == null)
|
||||
if (storableSubscriber == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(storableSubscriber));
|
||||
}
|
||||
|
||||
if(string.IsNullOrWhiteSpace(storableSubscriber.GatewayCustomerId))
|
||||
if (string.IsNullOrWhiteSpace(storableSubscriber.GatewayCustomerId))
|
||||
{
|
||||
throw new BadRequestException("No payment method found.");
|
||||
}
|
||||
|
||||
if(string.IsNullOrWhiteSpace(storableSubscriber.GatewaySubscriptionId))
|
||||
if (string.IsNullOrWhiteSpace(storableSubscriber.GatewaySubscriptionId))
|
||||
{
|
||||
throw new BadRequestException("No subscription found.");
|
||||
}
|
||||
|
||||
if(!storableSubscriber.MaxStorageGb.HasValue)
|
||||
if (!storableSubscriber.MaxStorageGb.HasValue)
|
||||
{
|
||||
throw new BadRequestException("No access to storage.");
|
||||
}
|
||||
|
||||
var newStorageGb = (short)(storableSubscriber.MaxStorageGb.Value + storageAdjustmentGb);
|
||||
if(newStorageGb < 1)
|
||||
if (newStorageGb < 1)
|
||||
{
|
||||
newStorageGb = 1;
|
||||
}
|
||||
|
||||
if(newStorageGb > 100)
|
||||
if (newStorageGb > 100)
|
||||
{
|
||||
throw new BadRequestException("Maximum storage is 100 GB.");
|
||||
}
|
||||
|
||||
var remainingStorage = storableSubscriber.StorageBytesRemaining(newStorageGb);
|
||||
if(remainingStorage < 0)
|
||||
if (remainingStorage < 0)
|
||||
{
|
||||
throw new BadRequestException("You are currently using " +
|
||||
$"{CoreHelpers.ReadableBytesSize(storableSubscriber.Storage.GetValueOrDefault(0))} of storage. " +
|
||||
|
||||
Reference in New Issue
Block a user