mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
Fix crash when saving unsupported attributes
This commit is contained in:
parent
309958deed
commit
0c46a82b10
2 changed files with 4 additions and 3 deletions
|
@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
- Fixed error messages for reading & writing roblox files not containing the full error message
|
||||
- Fixed crash when trying to access an instance reference property that points to a destroyed instance
|
||||
- Fixed crash when trying to save instances that contain unsupported attribute types
|
||||
|
||||
## `0.6.3` - March 26th, 2023
|
||||
|
||||
|
|
|
@ -24,11 +24,12 @@ pub fn ensure_valid_attribute_name(name: impl AsRef<str>) -> LuaResult<()> {
|
|||
}
|
||||
|
||||
pub fn ensure_valid_attribute_value(value: &DomValue) -> LuaResult<()> {
|
||||
// TODO: Uncomment supported types when they are also supported in rbx-dom serialization
|
||||
let is_valid = matches!(
|
||||
value.ty(),
|
||||
DomType::Bool
|
||||
| DomType::BrickColor
|
||||
| DomType::CFrame
|
||||
// | DomType::CFrame
|
||||
| DomType::Color3
|
||||
| DomType::ColorSequence
|
||||
| DomType::Float32
|
||||
|
@ -42,8 +43,7 @@ pub fn ensure_valid_attribute_value(value: &DomValue) -> LuaResult<()> {
|
|||
| DomType::UDim
|
||||
| DomType::UDim2
|
||||
| DomType::Vector2
|
||||
| DomType::Vector3
|
||||
| DomType::Font
|
||||
| DomType::Vector3 // | DomType::Font
|
||||
);
|
||||
if is_valid {
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue