Cannot click on non-electronic objects after adding custom interaction to electronic objects
Hi

I'm currently making a custom repair interaction for electronic objects (existing ones like TVs and computers, not custom or cloned objects). I'm using the unprotected DLLs. However, I'm encountering an issue. My Sims are not able to click on any objects except if they are electronic. So for example, all the existing interactions plus my custom interaction show up (and work as intended) when clicking on TVs, computers etc. But clicking on every other object doesn't even show the pie menu at all.
According to NRAAS ErrorTrap, there is an issue in the Test method, which makes sense since the Run method works, but the pie menus somehow get messed up. Also the error message shows "System.NullReferenceException: A null value was found where an object instance was required.", but since I'm checking whether the object is null or not in the method, I'm not sure what it could mean here. If necessary I can provide the whole script error description by ErrorTrap.
Here is the code snippet:
Code:
private sealed class Definition : InteractionDefinition<Sim, IGameObject, RepairObject>
{
public override string GetInteractionName(Sim a, IGameObject target, InteractionObjectPair interaction)
{
return "Repair object";
}
public override bool Test(Sim actor, IGameObject target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
if (actor.SimDescription.TeenOrAbove)
{
if (actor.IsSleeping || target.InUse || target == null)
{
return false;
}
if (!target.Repairable.Broken || (target.Repairable.ObjectRepairableType != RepairableComponent.RepairableType.Electrical))
{
return false;
}
return true;
}
return false;
}
}
I tried GameObject instead of IGameObject, but it didn't work either. I also tried to change the access modifiers (like changing public to private or protected), but I got an error notification, saying that the modifiers can't be changed.
Any help or ideas how to fix this are appreciated