misc: chore: Fix possible NullReferenceExceptions, InvalidOperationExceptions

This commit is contained in:
KeatonTheBot
2025-09-30 15:05:14 -05:00
parent fa682d406e
commit 51b32981b6
15 changed files with 70 additions and 49 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ namespace ARMeilleure.Translation
private static string GetKey(MethodInfo info)
{
return $"{info.DeclaringType.Name}.{info.Name}";
return $"{info.DeclaringType?.Name}.{info.Name}";
}
private static readonly SortedList<string, DelegateInfo> _delegates;
+5 -2
View File
@@ -316,13 +316,16 @@ namespace ARMeilleure.Translation
{
_root = newNode;
}
else if (start.CompareTo(parent.Start) < 0)
else if (parent != null && start.CompareTo(parent.Start) < 0)
{
parent.Left = newNode;
}
else
{
parent.Right = newNode;
if (parent != null)
{
parent.Right = newNode;
}
}
PropagateIncrease(newNode);