From 575e49f70c9580e04e428b3f08632289c5ef3559 Mon Sep 17 00:00:00 2001 From: Jeremy Sinclair <4016293+snickler@users.noreply.github.com> Date: Wed, 16 Aug 2023 13:19:16 -0400 Subject: [PATCH] ArgumentNullException.ThrowIfNull for CropAndLockViewModel --- .../ViewModels/CropAndLockViewModel.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) 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;