Skip to content

Commit facecbf

Browse files
committed
fix(WeaselTSF): explore user dir failed if it's not customized
1 parent c52f260 commit facecbf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

WeaselTSF/LanguageBar.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,12 +318,14 @@ void WeaselTSF::_HandleLangBarMenuSelect(UINT wID) {
318318
case ID_WEASELTRAY_USERCONFIG:
319319
if (RegGetStringValue(HKEY_CURRENT_USER, L"Software\\Rime\\Weasel",
320320
L"RimeUserDir", dir) == ERROR_SUCCESS) {
321-
if (dir.empty()) {
322-
TCHAR _path[MAX_PATH];
323-
ExpandEnvironmentStringsW(L"%AppData%\\Rime", _path, _countof(_path));
321+
explore(dir);
322+
} else {
323+
WCHAR _path[MAX_PATH] = {0};
324+
ExpandEnvironmentStringsW(L"%AppData%\\Rime", _path, _countof(_path));
325+
if (_path[0]) {
324326
dir = std::wstring(_path);
327+
explore(dir);
325328
}
326-
explore(dir);
327329
}
328330
break;
329331
case ID_WEASELTRAY_LOGDIR:

0 commit comments

Comments
 (0)