Avoid crash of paste null string to UI's text

This commit is contained in:
sum2012 2014-07-21 20:54:17 +08:00
parent 590724ea5c
commit ad3c8ebaa0

View file

@ -170,7 +170,10 @@ std::string System_GetProperty(SystemProperty prop) {
if (OpenClipboard(MainWindow::GetDisplayHWND())) {
HANDLE handle = GetClipboardData(CF_UNICODETEXT);
const wchar_t *wstr = (const wchar_t*)GlobalLock(handle);
retval = ConvertWStringToUTF8(wstr);
if (wstr)
retval = ConvertWStringToUTF8(wstr);
else
retval = "";
GlobalUnlock(handle);
CloseClipboard();
}