mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 08:15:33 +01:00
Merge pull request #5967 from JonnyH/WIP/more-robust-android-settings-parser
Make the Android settings parser a bit more robust
This commit is contained in:
commit
072b423de3
@ -274,13 +274,16 @@ public final class SettingsFile
|
|||||||
current = sectionFromLine(line);
|
current = sectionFromLine(line);
|
||||||
sections.put(current.getName(), current);
|
sections.put(current.getName(), current);
|
||||||
}
|
}
|
||||||
else if ((current != null) && line.contains("="))
|
else if ((current != null))
|
||||||
{
|
{
|
||||||
Setting setting = settingFromLine(current, line, fileName);
|
Setting setting = settingFromLine(current, line, fileName);
|
||||||
|
if (setting != null)
|
||||||
|
{
|
||||||
current.putSetting(setting);
|
current.putSetting(setting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
Log.error("[SettingsFile] File not found: " + fileName + ".ini: " + e.getMessage());
|
Log.error("[SettingsFile] File not found: " + fileName + ".ini: " + e.getMessage());
|
||||||
@ -381,6 +384,12 @@ public final class SettingsFile
|
|||||||
{
|
{
|
||||||
String[] splitLine = line.split("=");
|
String[] splitLine = line.split("=");
|
||||||
|
|
||||||
|
if (splitLine.length != 2)
|
||||||
|
{
|
||||||
|
Log.warning("Skipping invalid config line \"" + line + "\"");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
String key = splitLine[0].trim();
|
String key = splitLine[0].trim();
|
||||||
String value = splitLine[1].trim();
|
String value = splitLine[1].trim();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user