diff --git a/minigui.d b/minigui.d index bde8b73..8d87c45 100644 --- a/minigui.d +++ b/minigui.d @@ -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 {