Mapster
Mapster copied to clipboard
Provide more details on null reference questions
When mapping nested objects Mapster sometimes fails with
System.NullReferenceException: 'Object reference not set to an instance of an object.'
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=<Cannot evaluate the exception source>
StackTrace:
<Cannot evaluate the exception stack trace>
It does not provide details what property it actually failed on. Most of times it's impossible to evaluate manually where the point of failure is.
Could Mapster provide that information by catching the exception or some other means?
I have this same situation, how did you manage to solve your problem?
I have also this situation and don't understand why is failing, it should only set null value for the destination property.