fixed issue with WriteString crashing on null