core: fix unconditional access to union field
In several cases Value::sval has been acessed without proper type validation resulting in crashes on related incorrect inputs. The fix replaces non-validated union access with Value::text access.
In several cases Value::sval has been acessed without proper type validation resulting in crashes on related incorrect inputs. The fix replaces non-validated union access with Value::text access.