Skip to content

Commit

Permalink
Emit a real panic message when sstr bug occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
Dekkonot committed Sep 22, 2023
1 parent 223becc commit 7b54668
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rbx_binary/src/serializer/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1115,8 +1115,14 @@ impl<'dom, W: Write> SerializerState<'dom, W> {

for (i, rbx_value) in values {
if let Variant::SharedString(value) = rbx_value.as_ref() {
let id = &self.shared_string_ids[value];
entries.push(*id);
if let Some(id) = self.shared_string_ids.get(value) {
entries.push(*id);
} else {
panic!(
"SharedString {} was not found during type collection",
value.hash()
)
}
} else {
return type_mismatch(i, &rbx_value, "SharedString");
}
Expand Down

0 comments on commit 7b54668

Please sign in to comment.