add check for null editor