diff --git a/src/settings-ui/Settings.UI/ViewModels/CropAndLockViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/CropAndLockViewModel.cs index bb7ab40fc0..1ca9f0f506 100644 --- a/src/settings-ui/Settings.UI/ViewModels/CropAndLockViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/CropAndLockViewModel.cs @@ -26,28 +26,19 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels public CropAndLockViewModel(ISettingsUtils settingsUtils, ISettingsRepository settingsRepository, ISettingsRepository moduleSettingsRepository, Func 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;