Added null check in PlayerListener.