mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Filter] Add null checks on filter; attempt to find crash
This commit is contained in:
@@ -118,6 +118,18 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <returns>True if the file passed the filter, false otherwise</returns>
|
/// <returns>True if the file passed the filter, false otherwise</returns>
|
||||||
public bool ItemPasses(DatItem item, Logger logger)
|
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
|
// Filter on machine type
|
||||||
if (_machineTypes != MachineType.NULL && (item.Machine.MachineType & _machineTypes) == 0)
|
if (_machineTypes != MachineType.NULL && (item.Machine.MachineType & _machineTypes) == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user