diff --git a/SabreTools.Helper/Dats/Filter.cs b/SabreTools.Helper/Dats/Filter.cs index b42ae557..847433d6 100644 --- a/SabreTools.Helper/Dats/Filter.cs +++ b/SabreTools.Helper/Dats/Filter.cs @@ -118,6 +118,18 @@ namespace SabreTools.Helper.Dats /// True if the file passed the filter, false otherwise public bool ItemPasses(DatItem item, Logger logger) { + // If the item is null, we automatically fail it + if (item == null) + { + return false; + } + + // If the item's machine is null, we automatically fail it + if (item.Machine == null) + { + return false; + } + // Filter on machine type if (_machineTypes != MachineType.NULL && (item.Machine.MachineType & _machineTypes) == 0) {