GUI: No silent crash on startup if plugin option type has changed

This commit is contained in:
Katy Coe
2021-01-04 05:43:51 +01:00
parent 71be0f2af2
commit 92104315be

View File

@@ -165,7 +165,11 @@ namespace Il2CppInspectorGUI
_ => throw new ArgumentException("Unsupported JSON type")
});
}
managedPlugin.SetOptions(options, OptionBehaviour.NoValidation);
// An invalid cast will occur if a plugin author changes the type of one of its options
try {
managedPlugin.SetOptions(options, OptionBehaviour.NoValidation);
} catch (InvalidCastException) { }
}
}
}