better error handling

This commit is contained in:
rusEfi 2018-01-30 22:05:17 -05:00
parent 319abc861e
commit bf8184498d
2 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,7 @@ import static com.rusefi.ui.storage.PersistentConfiguration.getConfig;
* @see EngineSnifferPanel
*/
public class Launcher {
public static final int CONSOLE_VERSION = 20180125;
public static final int CONSOLE_VERSION = 20180130;
public static final boolean SHOW_STIMULATOR = false;
private static final String TAB_INDEX = "main_tab";
protected static final String PORT_KEY = "port";

View File

@ -101,8 +101,10 @@ public class FormulasPane {
int algorithm = ConfigField.getIntValue(ci, Fields.FUELALGORITHM);
engine_load_mode_e[] values = engine_load_mode_e.values();
if (algorithm >= values.length)
throw new IllegalStateException("Unexpected "+ algorithm);
if (algorithm >= values.length) {
FileLog.MAIN.logLine("Invalid algorithm" + algorithm);
algorithm = 0; // we are here for example in case of an invalid/incompatible configuration
}
engine_load_mode_e algo = values[algorithm];
String acceleration = getAccelerationVariables(ci) + NL2;