Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
harden conditions against garbage in custom state
It's not impossible for a user to declare that a TSU variable is of type string, but then actually populate it with something else entirely. Unfortunately, "TSU variables are trustworthy" is an invariant conditions relies on, so e.g. a condition to check if a string variable contains a substring would fail if a joker populated the state variable with a non-string value. Since Conditions are evaluated on a critical path to opening options, we need to trap any errors from this kind of shenanigans to allow the user to back out of their foolishness. Simply wrapping RunConditions in xpcall will possibly lead to half finished property applications, but that is much preferable to Options bricking up.
- Loading branch information