Fix error when previous exception received is null