I know sometimes innerException is null
So the following might fail:
repEvent.InnerException = ex.InnerException.Message;
Is ther
The simplest solution is to use a basic conditional expression:
repEvent.InnerException = ex.InnerException == null ? null : ex.InnerException.Message;