length check jic

This commit is contained in:
Adam D. Ruppe 2022-06-24 15:27:21 -04:00
parent f6306d331f
commit 047f937bb9
1 changed files with 1 additions and 1 deletions

View File

@ -13549,7 +13549,7 @@ void getFileName(
if(openOrSave ? GetOpenFileName(&ofn) : GetSaveFileName(&ofn))
{
string okString = makeUtf8StringFromWindowsString(ofn.lpstrFile);
if(okString[$-1] == '\0')
if(okString.length && okString[$-1] == '\0')
okString = okString[0..$-1];
onOK(okString);
} else {