Change config to skip bad options instead of emitting a giant error
package me.coley.recaf.config;
-import java.io.File;
-import java.io.StringWriter;
+import java.io.*;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
@@ -117,6 +116,7 @@ public abstract class Config {
continue;
}
+ try {
if(field.getType().equals(boolean.class)) {
field.set(this, value.asBoolean());
} else if(field.getType().equals(int.class)) {
@@ -135,8 +135,11 @@ public abstract class Config {
field.set(this, parsed);
}
}
- }
} catch(Exception e) {
+ Logging.error("Skipping bad option: " + confFile.getName() + " - " + name);
+ }
+ }
+ } catch (IOException e) {
Logging.error(e);
}
}
