* 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

@@ -19,6 +19,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
using System;
using SteamKit2;
namespace ArchiSteamFarm {
@@ -29,16 +30,14 @@ namespace ArchiSteamFarm {
internal static bool IsDebugBuild => false;
#endif
internal static bool IsDebugConfigured => ASF.GlobalConfig.Debug;
internal static bool IsDebugConfigured => ASF.GlobalConfig?.Debug ?? throw new ArgumentNullException(nameof(ASF.GlobalConfig));
internal static bool IsUserDebugging => IsDebugBuild || IsDebugConfigured;
internal sealed class DebugListener : IDebugListener {
public void WriteLine(string category, string msg) {
if (string.IsNullOrEmpty(category) && string.IsNullOrEmpty(msg)) {
ASF.ArchiLogger.LogNullError(nameof(category) + " && " + nameof(msg));
return;
throw new ArgumentNullException(nameof(category) + " && " + nameof(msg));
}
ASF.ArchiLogger.LogGenericDebug(category + " | " + msg);