Closed dymanoid closed 6 years ago
Which version of Harmony and can you give me more info on the signatures of both, the original and the patch methods?
Oh, sorry. I updated the issue with the info you requested.
Maybe you could help me and use/compile a debug version of Harmony so the stacktrace contains line numbers. Without more info I could only guess since I do not have all the information about all the types and classes involved and the call argument emitter code has lots of use cases that cannot be deduced from your information.
I think I spotted the issue. The problem was that the target class has both a field and a property with very similar names, and I accidentally used the property instead of the field.
Nevertheless, my suggestion would be to make the exception message be more helpful at this point. Something like 'field xxx not found' rather than just an anonymous NRE.
Great work. That’s an easy fix, thank you.
Fixed in https://github.com/pardeike/Harmony/commit/7e1e5623a1818d309a2946baff6f27359c1b70c8. Please verify.
Harmony version 1.1.0.
I'm adding a patch for a method in the Cities:Skylines game. For a particular method, on trying to add a postfix, I get a NRE:
The prefix method parameters include some instance fields (
___fieldName
), the instance itself (__instance
), and the original method's parameters (which are correct).Original method's signature:
Postfix signature: