Return nil when an exception occurs