Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl Display for Element panics for typed nulls #450

Closed
popematt opened this issue Dec 1, 2022 · 0 comments · Fixed by #451
Closed

impl Display for Element panics for typed nulls #450

popematt opened this issue Dec 1, 2022 · 0 comments · Fixed by #451

Comments

@popematt
Copy link
Contributor

popematt commented Dec 1, 2022

For example, this test:

#[test]
fn print_a_typed_null() {
    let value: Element = element_reader().read_one("null.bool".as_bytes()).unwrap();
    println!("{}", value)
}

results in this output:

thread 'print_a_typed_null' panicked at 'called `Option::unwrap()` on a `None` value'

It's caused by this line:
https://github.com/amzn/ion-rust/blob/aa33f0fb8b5e4965d56e48fd337b813dded32278/src/value/owned.rs#L466

It's probably a good idea to also check why it wasn't caught by any of our existing tests (particularly https://github.com/amzn/ion-rust/blob/main/tests/element_test_vectors.rs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant