Checks the current reference is not null before cancelling pending toast

This PR prevents a NPE thrown when trying to cancel the current toast while it has not been initialised yet.