* 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

@@ -29,7 +29,7 @@ namespace ArchiSteamFarm.Helpers {
public abstract class SerializableFile : IDisposable {
private readonly SemaphoreSlim FileSemaphore = new SemaphoreSlim(1, 1);
protected string FilePath { private get; set; }
protected string? FilePath { private get; set; }
private bool ReadOnly;
private bool SavingScheduled;
@@ -37,7 +37,11 @@ namespace ArchiSteamFarm.Helpers {
public virtual void Dispose() => FileSemaphore.Dispose();
protected async Task Save() {
if (ReadOnly || string.IsNullOrEmpty(FilePath)) {
if (string.IsNullOrEmpty(FilePath)) {
throw new ArgumentNullException(nameof(FilePath));
}
if (ReadOnly) {
return;
}