mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Merge pull request #15174 from peppy/disable-stupid-syntax
Disable new null check inspections which we won't be using
This commit is contained in:
commit
cd80d8eb51
@ -39,17 +39,19 @@ namespace osu.Game.Online.API
|
||||
if (string.IsNullOrEmpty(username)) throw new ArgumentException("Missing username.");
|
||||
if (string.IsNullOrEmpty(password)) throw new ArgumentException("Missing password.");
|
||||
|
||||
using (var req = new AccessTokenRequestPassword(username, password)
|
||||
var accessTokenRequest = new AccessTokenRequestPassword(username, password)
|
||||
{
|
||||
Url = $@"{endpoint}/oauth/token",
|
||||
Method = HttpMethod.Post,
|
||||
ClientId = clientId,
|
||||
ClientSecret = clientSecret
|
||||
})
|
||||
};
|
||||
|
||||
using (accessTokenRequest)
|
||||
{
|
||||
try
|
||||
{
|
||||
req.Perform();
|
||||
accessTokenRequest.Perform();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -60,7 +62,7 @@ namespace osu.Game.Online.API
|
||||
try
|
||||
{
|
||||
// attempt to decode a displayable error string.
|
||||
var error = JsonConvert.DeserializeObject<OAuthError>(req.GetResponseString() ?? string.Empty);
|
||||
var error = JsonConvert.DeserializeObject<OAuthError>(accessTokenRequest.GetResponseString() ?? string.Empty);
|
||||
if (error != null)
|
||||
throwableException = new APIException(error.UserDisplayableError, ex);
|
||||
}
|
||||
@ -71,7 +73,7 @@ namespace osu.Game.Online.API
|
||||
throw throwableException;
|
||||
}
|
||||
|
||||
Token.Value = req.ResponseObject;
|
||||
Token.Value = accessTokenRequest.ResponseObject;
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,17 +81,19 @@ namespace osu.Game.Online.API
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var req = new AccessTokenRequestRefresh(refresh)
|
||||
var refreshRequest = new AccessTokenRequestRefresh(refresh)
|
||||
{
|
||||
Url = $@"{endpoint}/oauth/token",
|
||||
Method = HttpMethod.Post,
|
||||
ClientId = clientId,
|
||||
ClientSecret = clientSecret
|
||||
})
|
||||
{
|
||||
req.Perform();
|
||||
};
|
||||
|
||||
Token.Value = req.ResponseObject;
|
||||
using (refreshRequest)
|
||||
{
|
||||
refreshRequest.Perform();
|
||||
|
||||
Token.Value = refreshRequest.ResponseObject;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,7 @@
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToLocalFunction/@EntryIndexedValue">HINT</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToStaticClass/@EntryIndexedValue">WARNING</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToUsingDeclaration/@EntryIndexedValue">HINT</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertTypeCheckPatternToNullCheck/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DoubleNegationOperator/@EntryIndexedValue">WARNING</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EmptyGeneralCatchClause/@EntryIndexedValue">DO_NOT_SHOW</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceDoWhileStatementBraces/@EntryIndexedValue">WARNING</s:String>
|
||||
|
Loading…
Reference in New Issue
Block a user