mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-21 16:58:37 +00:00
* Start working on nullable checks help me * Update GlobalConfig.cs * Finish initial fixup round * nullability code review
This commit is contained in:
committed by
GitHub
parent
e5f64ec9dd
commit
9fc1ea65a5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user