diff options
-rw-r--r-- | win32/PlatWin.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index d3de3c9ad..c7435f212 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1118,7 +1118,7 @@ PRectangle ListBoxX::GetDesiredRect() { HDC hdc = ::GetDC(lb); HFONT oldFont = SelectFont(hdc, fontCopy); SIZE textSize = {0, 0}; - int len = strlen(widestItem); + int len = widestItem ? strlen(widestItem) : 0; if (unicodeMode) { wchar_t tbuf[MAX_US_LEN]; int tlen = UCS2FromUTF8(widestItem, len, tbuf, sizeof(tbuf)/sizeof(wchar_t)-1); |