mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-15 03:40:35 +00:00
Fix potential crash in Video Settings.
When Shaders folder didn't exist it would cause crash.
This commit is contained in:
parent
31eedb2f79
commit
7dc31fbd1a
@ -63,7 +63,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
|
||||
//
|
||||
// Set available post processing shaders
|
||||
//
|
||||
File[] shaders = new File(Environment.getExternalStorageDirectory()+ File.separator+"dolphin-emu"+ File.separator+"Shaders").listFiles();
|
||||
|
||||
List<CharSequence> shader_names = new ArrayList<CharSequence>();
|
||||
List<CharSequence> shader_values = new ArrayList<CharSequence>();
|
||||
|
||||
@ -71,6 +71,10 @@ public final class VideoSettingsFragment extends PreferenceFragment
|
||||
shader_names.add("Disabled");
|
||||
shader_values.add("");
|
||||
|
||||
File shaders_folder = new File(Environment.getExternalStorageDirectory()+ File.separator+"dolphin-emu"+ File.separator+"Shaders");
|
||||
if (shaders_folder.exists())
|
||||
{
|
||||
File[] shaders = shaders_folder.listFiles();
|
||||
for (File file : shaders)
|
||||
{
|
||||
if (file.isFile())
|
||||
@ -84,6 +88,7 @@ public final class VideoSettingsFragment extends PreferenceFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final ListPreference shader_preference = (ListPreference) findPreference("postProcessingShader");
|
||||
shader_preference.setEntries(shader_names.toArray(new CharSequence[shader_names.size()]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user