mirror of
https://github.com/bitwarden/server
synced 2025-12-26 05:03:18 +00:00
Changed all C# control flow block statements to include space between keyword and open paren
This commit is contained in:
@@ -17,9 +17,9 @@ namespace Bit.Admin.Models
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if(Id != null)
|
||||
if (Id != null)
|
||||
{
|
||||
if(Id.Length != 36 || (Id[0] != 'o' && Id[0] != 'u') ||
|
||||
if (Id.Length != 36 || (Id[0] != 'o' && Id[0] != 'u') ||
|
||||
!Guid.TryParse(Id.Substring(1, 32), out var guid))
|
||||
{
|
||||
yield return new ValidationResult("Customer Id is not a valid format.");
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Bit.Admin.Models
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if((!UserId.HasValue && !OrganizationId.HasValue) || (UserId.HasValue && OrganizationId.HasValue))
|
||||
if ((!UserId.HasValue && !OrganizationId.HasValue) || (UserId.HasValue && OrganizationId.HasValue))
|
||||
{
|
||||
yield return new ValidationResult("Must provide either User Id, or Organization Id.");
|
||||
}
|
||||
|
||||
@@ -21,30 +21,30 @@ namespace Bit.Admin.Models
|
||||
|
||||
public string ExceptionToString(JObject e)
|
||||
{
|
||||
if(e == null)
|
||||
if (e == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var val = string.Empty;
|
||||
if(e["Message"] != null && e["Message"].ToObject<string>() != null)
|
||||
if (e["Message"] != null && e["Message"].ToObject<string>() != null)
|
||||
{
|
||||
val += "Message:\n";
|
||||
val += e["Message"] + "\n";
|
||||
}
|
||||
|
||||
if(e["StackTrace"] != null && e["StackTrace"].ToObject<string>() != null)
|
||||
if (e["StackTrace"] != null && e["StackTrace"].ToObject<string>() != null)
|
||||
{
|
||||
val += "\nStack Trace:\n";
|
||||
val += e["StackTrace"];
|
||||
}
|
||||
else if(e["StackTraceString"] != null && e["StackTraceString"].ToObject<string>() != null)
|
||||
else if (e["StackTraceString"] != null && e["StackTraceString"].ToObject<string>() != null)
|
||||
{
|
||||
val += "\nStack Trace String:\n";
|
||||
val += e["StackTraceString"];
|
||||
}
|
||||
|
||||
if(e["InnerException"] != null && e["InnerException"].ToObject<JObject>() != null)
|
||||
if (e["InnerException"] != null && e["InnerException"].ToObject<JObject>() != null)
|
||||
{
|
||||
val += "\n\n=== Inner Exception ===\n\n";
|
||||
val += ExceptionToString(e["InnerException"].ToObject<JObject>());
|
||||
|
||||
Reference in New Issue
Block a user