Fix writeconern null reference issue.