Added null check for PreserveStackTraceMethod so it works in mono