Check that activity != null before showing toast message in edit media callback.