Check for null listener

Jira issue: WP-934