ArgumentNullException.ThrowIfNull for CropAndLockViewModel

This commit is contained in:
Jeremy Sinclair 2023-08-16 13:19:16 -04:00
parent c05270aafd
commit 575e49f70c

View File

@ -26,28 +26,19 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
public CropAndLockViewModel(ISettingsUtils settingsUtils, ISettingsRepository<GeneralSettings> settingsRepository, ISettingsRepository<CropAndLockSettings> moduleSettingsRepository, Func<string, int> ipcMSGCallBackFunc)
{
if (settingsUtils == null)
{
throw new ArgumentNullException(nameof(settingsUtils));
}
ArgumentNullException.ThrowIfNull(settingsUtils);
SettingsUtils = settingsUtils;
// To obtain the general settings configurations of PowerToys Settings.
if (settingsRepository == null)
{
throw new ArgumentNullException(nameof(settingsRepository));
}
ArgumentNullException.ThrowIfNull(settingsRepository);
GeneralSettingsConfig = settingsRepository.SettingsConfig;
InitializeEnabledValue();
// To obtain the settings configurations of CropAndLock.
if (moduleSettingsRepository == null)
{
throw new ArgumentNullException(nameof(moduleSettingsRepository));
}
ArgumentNullException.ThrowIfNull(moduleSettingsRepository);
Settings = moduleSettingsRepository.SettingsConfig;