Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Edit Particles" NullReferenceException
#5
A NullReferenceException exception is thrown when you try to access a member on a type whose value is null. A NullReferenceException exception typically reflects as developer error. To fully understand why a NullReferenceException is thrown, it is important to know the difference between value types and reference types.

So, if you're dealing with value types, NullReferenceExceptions can not occur. Though you need to keep alert when dealing with reference types!

Only reference types, as the name is suggesting, can hold references or point literally to nothing (or 'null'). Whereas value types always contain a value.

Reference types (these ones must be checked):
  • dynamic
  • object
  • string
Value types (you can simply ignore these ones):
  • Numeric types
  • Integral types
  • Floating-point types
  • decimal
  • bool
  • User defined structs
Reply


Messages In This Thread
RE: "Edit Particles" NullReferenceException - by allenmarsh - 31-07-2018, 06:58 AM