NullReferenceException

This commit is contained in:
2022-08-13 11:19:08 -07:00
parent 3aeab88384
commit 0392de1920
33 changed files with 1278 additions and 1030 deletions

View File

@ -65,37 +65,37 @@ public class Configuration
public static void Verify(Configuration? propertyConfiguration)
{
if (propertyConfiguration is null)
throw new ArgumentNullException(nameof(propertyConfiguration));
throw new NullReferenceException(nameof(propertyConfiguration));
if (propertyConfiguration.ForcePropertyLastWriteTimeToCreationTime is null)
throw new ArgumentNullException(nameof(propertyConfiguration.ForcePropertyLastWriteTimeToCreationTime));
throw new NullReferenceException(nameof(propertyConfiguration.ForcePropertyLastWriteTimeToCreationTime));
if (propertyConfiguration.IgnoreExtensions is null || !propertyConfiguration.IgnoreExtensions.Any())
throw new ArgumentNullException(nameof(propertyConfiguration.IgnoreExtensions));
throw new NullReferenceException(nameof(propertyConfiguration.IgnoreExtensions));
if (propertyConfiguration.PopulatePropertyId is null)
throw new ArgumentNullException(nameof(propertyConfiguration.PopulatePropertyId));
throw new NullReferenceException(nameof(propertyConfiguration.PopulatePropertyId));
if (propertyConfiguration.PropertiesChangedForProperty is null)
throw new ArgumentNullException(nameof(propertyConfiguration.PropertiesChangedForProperty));
throw new NullReferenceException(nameof(propertyConfiguration.PropertiesChangedForProperty));
if (propertyConfiguration.PropertyContentCollectionFiles is null)
throw new ArgumentNullException(nameof(propertyConfiguration.PropertyContentCollectionFiles));
throw new NullReferenceException(nameof(propertyConfiguration.PropertyContentCollectionFiles));
if (propertyConfiguration.ValidImageFormatExtensions is null || !propertyConfiguration.ValidImageFormatExtensions.Any())
throw new ArgumentNullException(nameof(propertyConfiguration.ValidImageFormatExtensions));
throw new NullReferenceException(nameof(propertyConfiguration.ValidImageFormatExtensions));
if (propertyConfiguration.ValidMetadataExtensions is null || !propertyConfiguration.ValidMetadataExtensions.Any())
throw new ArgumentNullException(nameof(propertyConfiguration.ValidMetadataExtensions));
throw new NullReferenceException(nameof(propertyConfiguration.ValidMetadataExtensions));
if (propertyConfiguration.VerifyToSeason is null || !propertyConfiguration.VerifyToSeason.Any())
throw new ArgumentNullException(nameof(propertyConfiguration.VerifyToSeason));
throw new NullReferenceException(nameof(propertyConfiguration.VerifyToSeason));
if (propertyConfiguration.WriteBitmapDataBytes is null)
throw new ArgumentNullException(nameof(propertyConfiguration.WriteBitmapDataBytes));
throw new NullReferenceException(nameof(propertyConfiguration.WriteBitmapDataBytes));
if (Path.GetPathRoot(propertyConfiguration.RootDirectory) == propertyConfiguration.RootDirectory)
throw new ArgumentNullException(nameof(propertyConfiguration.RootDirectory));
throw new NullReferenceException(nameof(propertyConfiguration.RootDirectory));
if (propertyConfiguration is null)
throw new ArgumentNullException(nameof(propertyConfiguration));
throw new NullReferenceException(nameof(propertyConfiguration));
if (string.IsNullOrEmpty(propertyConfiguration.DateGroup))
throw new ArgumentNullException(nameof(propertyConfiguration.DateGroup));
throw new NullReferenceException(nameof(propertyConfiguration.DateGroup));
if (string.IsNullOrEmpty(propertyConfiguration.FileNameDirectorySeparator))
throw new ArgumentNullException(nameof(propertyConfiguration.FileNameDirectorySeparator));
throw new NullReferenceException(nameof(propertyConfiguration.FileNameDirectorySeparator));
if (string.IsNullOrEmpty(propertyConfiguration.Pattern))
throw new ArgumentNullException(nameof(propertyConfiguration.Pattern));
throw new NullReferenceException(nameof(propertyConfiguration.Pattern));
if (string.IsNullOrEmpty(propertyConfiguration.RootDirectory) || !Directory.Exists(propertyConfiguration.RootDirectory))
throw new ArgumentNullException(nameof(propertyConfiguration.RootDirectory));
throw new NullReferenceException(nameof(propertyConfiguration.RootDirectory));
}
public void ChangeRootDirectory(string rootDirectory) => _RootDirectory = rootDirectory;