Skip to content

Commit 61fc34c

Browse files
committed
check sound file existences
1 parent 12638ff commit 61fc34c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

GUI.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,13 +1229,19 @@ bool __fastcall XgLoadSettings(void)
12291229
}
12301230

12311231
if (!app_key.QuerySz(L"SoundFile0", sz, _countof(sz))) {
1232-
StringCchCopy(xg_aszSoundFiles[0], _countof(xg_aszSoundFiles[0]), sz);
1232+
if (PathFileExistsW(sz)) {
1233+
StringCchCopy(xg_aszSoundFiles[0], _countof(xg_aszSoundFiles[0]), sz);
1234+
}
12331235
}
12341236
if (!app_key.QuerySz(L"SoundFile1", sz, _countof(sz))) {
1235-
StringCchCopy(xg_aszSoundFiles[1], _countof(xg_aszSoundFiles[1]), sz);
1237+
if (PathFileExistsW(sz)) {
1238+
StringCchCopy(xg_aszSoundFiles[1], _countof(xg_aszSoundFiles[1]), sz);
1239+
}
12361240
}
12371241
if (!app_key.QuerySz(L"SoundFile2", sz, _countof(sz))) {
1238-
StringCchCopy(xg_aszSoundFiles[2], _countof(xg_aszSoundFiles[2]), sz);
1242+
if (PathFileExistsW(sz)) {
1243+
StringCchCopy(xg_aszSoundFiles[2], _countof(xg_aszSoundFiles[2]), sz);
1244+
}
12391245
}
12401246

12411247
// 保存先のリストを取得する。

0 commit comments

Comments
 (0)