Just a quick update: yesterday I stayed up until 3:30 AM and I debugged the game to try to understand what variable was null (that was the cause of the exception). The issue appears to be in the following method:
public Location GetLocationOfCharacter(LocationCharacter character)
{
Location location1 = (Location) null;
foreach (KeyValuePair<string, Location> location2 in this._locations)
{
if (location2.Value.ContainsCharacter(character))
location1 = location2.Value;
}
return location1;
}
The exception happens at the line "location1 = location.Value", even if it has no sense. In fact, after setting a break point on the exact line, for some reason the exception seems to disappear: what I mean is that if I try to recruit a companion while the breakpoint is on that line and I'm attached to the Bannerlord process to debug, the issue doesn't happen. I tried it three times just to be sure, but it's really weird. And besides that, I still have to understand why all the NPCs have the white "Location" string appearing under their stats. I still can't link or post images tho, so I can't show you yet.