4 ms·
Yes, but any of the passed-in arguments can be null if they are de-referenced without checking, or you can muck up your context by doing something weird. I'm n
by niftich 10y ago
Yes, but any of the passed-in arguments can be null if they are de-referenced without checking, or you can muck up your context by doing something weird.
I'm not justifying buggy code, but these days we do handle more objects-per-debug-line-number than we used to.
- tracker1 10y agoEspecially in lambda expressions for LINQ methods...
- ygra 10y agoBut you can already debug inside lambda expressions. E.g. for new string[] { "1", null }.Select(s => s.Length).ToList(); VS has no trouble at all telling me the statement that caused the NRE and I can inspect variables local to the lambda as well.
- pionar 10y agoBut you can't always debug code that's out in the wild with the same exact scenario that caused the NRE. It's helpful to have the actual thing that's null for post-error troubleshooting.
- ygra 10y agoThe whole discussion is about a debugger feature, or at least, the runtime groundwork required for said debugger feature. It will not result in the exception message telling you the null reference's name. It enables an attached debugger to query the runtime for additional information to determine that.