fix wstring size bug when string is NULL