Fix possible NPE on invalid events that don't exist.