mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Simplify LogNullError calls (#2554)
* Remove necessity of nameof(...) in calls to ArchiLogger.LogNullError(...) * Upgrade Madness * Upgrade Madness * Split up compound null log statements
This commit is contained in:
@@ -94,7 +94,7 @@ internal static class GitHub {
|
||||
IElement? versionNode = revisionNode.SelectSingleElementNode(".//input/@value");
|
||||
|
||||
if (versionNode == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(versionNode));
|
||||
ASF.ArchiLogger.LogNullError(versionNode);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ internal static class GitHub {
|
||||
string versionText = versionNode.GetAttribute("value");
|
||||
|
||||
if (string.IsNullOrEmpty(versionText)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(versionText));
|
||||
ASF.ArchiLogger.LogNullError(versionText);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ internal static class GitHub {
|
||||
IElement? dateTimeNode = revisionNode.SelectSingleElementNode(".//relative-time/@datetime");
|
||||
|
||||
if (dateTimeNode == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(dateTimeNode));
|
||||
ASF.ArchiLogger.LogNullError(dateTimeNode);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -118,13 +118,13 @@ internal static class GitHub {
|
||||
string dateTimeText = dateTimeNode.GetAttribute("datetime");
|
||||
|
||||
if (string.IsNullOrEmpty(dateTimeText)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(dateTimeText));
|
||||
ASF.ArchiLogger.LogNullError(dateTimeText);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!DateTime.TryParse(dateTimeText, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal | DateTimeStyles.AssumeUniversal, out DateTime dateTime)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(dateTime));
|
||||
ASF.ArchiLogger.LogNullError(dateTime);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ internal static class GitHub {
|
||||
}
|
||||
|
||||
if (Changelog == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(Changelog));
|
||||
ASF.ArchiLogger.LogNullError(Changelog);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -246,7 +246,7 @@ internal static class GitHub {
|
||||
}
|
||||
|
||||
if (Changelog == null) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(Changelog));
|
||||
ASF.ArchiLogger.LogNullError(Changelog);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -276,7 +276,7 @@ internal static class GitHub {
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(MarkdownBody)) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(MarkdownBody));
|
||||
ASF.ArchiLogger.LogNullError(MarkdownBody);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ public sealed class WebBrowser : IDisposable {
|
||||
Uri? redirectUri = response.Headers.Location;
|
||||
|
||||
if (redirectUri == null) {
|
||||
ArchiLogger.LogNullError(nameof(redirectUri));
|
||||
ArchiLogger.LogNullError(redirectUri);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user