* Start working on nullable checks

help me

* Update GlobalConfig.cs

* Finish initial fixup round

* nullability code review
This commit is contained in:
Łukasz Domeradzki
2020-08-22 21:41:01 +02:00
committed by GitHub
parent e5f64ec9dd
commit 9fc1ea65a5
91 changed files with 1996 additions and 2808 deletions

View File

@@ -39,18 +39,16 @@ namespace ArchiSteamFarm.IPC.Controllers.Api {
[ProducesResponseType(typeof(GenericResponse), (int) HttpStatusCode.BadRequest)]
public ActionResult<GenericResponse> StructureGet(string structure) {
if (string.IsNullOrEmpty(structure)) {
ASF.ArchiLogger.LogNullError(nameof(structure));
return BadRequest(new GenericResponse(false, string.Format(Strings.ErrorIsEmpty, nameof(structure))));
throw new ArgumentNullException(nameof(structure));
}
Type targetType = WebUtilities.ParseType(structure);
Type? targetType = WebUtilities.ParseType(structure);
if (targetType == null) {
return BadRequest(new GenericResponse(false, string.Format(Strings.ErrorIsInvalid, structure)));
}
object obj;
object? obj;
try {
obj = Activator.CreateInstance(targetType, true);