Fix a crash upon relaunching after removing a SD/USB device (#479)

This commit is contained in:
InfiniteBlueGX 2022-10-24 10:35:17 -05:00 committed by GitHub
parent bdf40d33c2
commit ca59df2961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -634,7 +634,9 @@ bool LoadPrefs()
FixInvalidSettings(); FixInvalidSettings();
// attempt to create directories if they don't exist // attempt to create directories if they don't exist
if(GCSettings.LoadMethod == DEVICE_SD || GCSettings.LoadMethod == DEVICE_USB) { if((GCSettings.LoadMethod == DEVICE_SD && ChangeInterface(DEVICE_SD, SILENT))
|| (GCSettings.LoadMethod == DEVICE_USB && ChangeInterface(DEVICE_USB, SILENT)))
{
char dirPath[MAXPATHLEN]; char dirPath[MAXPATHLEN];
sprintf(dirPath, "%s%s", pathPrefix[GCSettings.LoadMethod], GCSettings.ScreenshotsFolder); sprintf(dirPath, "%s%s", pathPrefix[GCSettings.LoadMethod], GCSettings.ScreenshotsFolder);
CreateDirectory(dirPath); CreateDirectory(dirPath);