Fix possible NPE with null Intent.