proper null ptr check for string/wstring