This will throw a null reference exception when InnerException is null.
String s = " inner exception: " + e.InnerException == null ? "None" : e.InnerException.Message;
but this won't:
String s = " inner exception: " + (e.InnerException == null ? "None" : e.InnerException.Message);
Both of the above build fine. I can't figure out what the former is trying to do that would cause it to evaluate e.InnerException.Message
. Why aren't they equivalent?