Ben.Demystifier icon indicating copy to clipboard operation
Ben.Demystifier copied to clipboard

only get field value when is delegate

Open SimonCropp opened this issue 3 years ago • 0 comments

  • slight perf improvement. avoid a field getvalue when types dont match and dont unnecessarily trigger a static constructor
  • reduces the chance of an exception in a static constructor from bubbling up

found in sentry: Exception Thrown in a Static Constructor Is Not Being Sent To Sentry

@benaadams given a static constructor (triggered by the getfield) could still throw, do you think the get field logic should be wrapped in a try? i would assume a slightly less accurate display name i better than an exception?

SimonCropp avatar Dec 23 '21 06:12 SimonCropp