misc: chore: Fix numerous NullReferenceExceptions, InvalidOperationExceptions

This commit is contained in:
KeatonTheBot 2025-06-17 17:17:31 -05:00
parent a90db3464d
commit d2a532f971
90 changed files with 667 additions and 533 deletions

View file

@ -162,7 +162,7 @@ namespace Spv.Generator
public bool Equals(Instruction cmpObj)
{
bool result = Type == cmpObj.Type && Id == cmpObj.Id;
bool result = cmpObj != null && Type == cmpObj.Type && Id == cmpObj.Id;
if (result)
{

View file

@ -87,7 +87,7 @@ namespace Spv.Generator
public bool Equals(LiteralInteger cmpObj)
{
return Type == cmpObj.Type && _integerType == cmpObj._integerType && _data == cmpObj._data;
return cmpObj != null && Type == cmpObj.Type && _integerType == cmpObj._integerType && _data == cmpObj._data;
}
public override int GetHashCode()

View file

@ -36,7 +36,7 @@ namespace Spv.Generator
public bool Equals(LiteralString cmpObj)
{
return Type == cmpObj.Type && _value.Equals(cmpObj._value);
return cmpObj != null && Type == cmpObj.Type && _value.Equals(cmpObj._value);
}
public override int GetHashCode()