fix: null check (#11831)

[skip changelog]
This commit is contained in:
status102
2025-02-10 15:38:18 +08:00
committed by GitHub
parent aa4bd03e38
commit 656256dc66
3 changed files with 5 additions and 6 deletions

View File

@@ -31,7 +31,6 @@ using MaaWpfGui.Services.HotKeys;
using MaaWpfGui.States;
using MaaWpfGui.Utilities.ValueType;
using MaaWpfGui.ViewModels.UserControl.Settings;
using MaaWpfGui.ViewModels.UserControl.TaskQueue;
using Newtonsoft.Json;
using Serilog;
using Stylet;
@@ -362,7 +361,7 @@ namespace MaaWpfGui.ViewModels.UI
#region
public ObservableCollection<CombinedData> ConfigurationList { get; set; }
public ObservableCollection<CombinedData> ConfigurationList { get; set; } = [];
private string? _currentConfiguration = ConfigurationHelper.GetCurrentConfiguration();
@@ -378,7 +377,7 @@ namespace MaaWpfGui.ViewModels.UI
}
}
private string _newConfigurationName;
private string _newConfigurationName = string.Empty;
public string NewConfigurationName
{
@@ -495,7 +494,7 @@ namespace MaaWpfGui.ViewModels.UI
private NotifyType _notifySource = NotifyType.None;
private Timer _resetNotifyTimer;
private Timer? _resetNotifyTimer;
private void ResetNotifySource()
{

View File

@@ -554,7 +554,7 @@ public class FightSettingsUserControlModel : TaskViewModel
/// <summary>
/// Gets or private sets the list of drops.
/// </summary>
public ObservableCollection<CombinedData> DropsList { get; private set; }
public ObservableCollection<CombinedData> DropsList { get; private set; } = [];
private string _dropsItemId = ConfigurationHelper.GetValue(ConfigurationKeys.DropsItemId, string.Empty);

View File

@@ -145,7 +145,7 @@ public class InfrastSettingsUserControlModel : TaskViewModel
}
}
private string _dormThresholdLabel;
private string _dormThresholdLabel = string.Empty;
/// <summary>
/// Gets or sets the label of dormitory threshold.