Added check for a null exception "cause" to avoid NPE when the exception
doesn't have a root cause attached.