# Thread 'main' panicked at method\_application.rs: called \`Option::unwrap()\` on a \`None\` value

**URL:** <https://forum.fuel.network/t/thread-main-panicked-at-method-application-rs-called-option-unwrap-on-a-none-value/5356>\
**Category:** Sway\
**Tags:** testnet, feedback, tips\
**Created:** [May 25, 2024, 10:42am UTC](https://forum.fuel.network/t/thread-main-panicked-at-method-application-rs-called-option-unwrap-on-a-none-value/5356 "2024-05-25T10:42:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![theAusicist](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/theausicist/32/1987_2.png) [@theAusicist](https://forum.fuel.network/u/theAusicist)\
**Post date:** [May 25, 2024, 10:42am UTC](https://forum.fuel.network/t/thread-main-panicked-at-method-application-rs-called-option-unwrap-on-a-none-value/5356/1 "2024-05-25T10:42:52Z")

</div>

Quick heads-up on a bug I found in the compiler:

this error:

```bash

thread 'main' panicked at sway-core/src/semantic_analysis/ast_node/expression/typed_expression/method_application.rs:127:26:

called `Option::unwrap()` on a `None` value

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

```

can be removed by changing all `.value`s to `.into()`s. Isn’t applicable to the newer versions of the compiler since it forces you to write `into()`s, but worth pointing out.

The above code was compilable under `v0.49.3` and below (basically, you could access the `.value` field in the structs which is private now and not allowed under the newer versions.

---

<div class="post-metadata">

**Author:** ![naz3eh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/naz3eh/32/2025_2.png) [@naz3eh](https://forum.fuel.network/u/naz3eh)\
**Post date:** [May 27, 2024, 6:39am UTC](https://forum.fuel.network/t/thread-main-panicked-at-method-application-rs-called-option-unwrap-on-a-none-value/5356/3 "2024-05-27T06:39:58Z")

</div>

Thanks for reporting it. I have shared this with the team and are waiting for their input. Will lyk if there are any further updates on this. 🙂

---

<div class="post-metadata">

**Author:** ![naz3eh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/naz3eh/32/2025_2.png) [@naz3eh](https://forum.fuel.network/u/naz3eh)\
**Post date:** [May 27, 2024, 9:56am UTC](https://forum.fuel.network/t/thread-main-panicked-at-method-application-rs-called-option-unwrap-on-a-none-value/5356/4 "2024-05-27T09:56:17Z")

</div>

Hey @theAusicistkl, can you share the repo for it?

---

<div class="post-metadata">

**Author:** ![theAusicist](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/theausicist/32/1987_2.png) [@theAusicist](https://forum.fuel.network/u/theAusicist)\
**Post date:** [May 27, 2024, 1:55pm UTC](https://forum.fuel.network/t/thread-main-panicked-at-method-application-rs-called-option-unwrap-on-a-none-value/5356/5 "2024-05-27T13:55:21Z")

</div>

I can confirm that the issue is when you try to access the `.value` field on a storage variable like so.

```rust
let res: b256 = storage.some_asset.read().value; 
// instead of
let res: b256 = storage.some_asset.read().into();

```

---

<div class="post-metadata">

**Author:** ![naz3eh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/naz3eh/32/2025_2.png) [@naz3eh](https://forum.fuel.network/u/naz3eh)\
**Post date:** [June 26, 2024, 8:58am UTC](https://forum.fuel.network/t/thread-main-panicked-at-method-application-rs-called-option-unwrap-on-a-none-value/5356/6 "2024-06-26T08:58:59Z")

</div>

Forgot to update it here, we have created an issue for this. You can track it down here [Bug: Thread 'main' panicked at method\_application.rs: called `Option::unwrap()` on a `None` value · Issue #6060 · FuelLabs/sway · GitHub](https://github.com/FuelLabs/sway/issues/6060)
