# The emulator can run normally, but an error is reported in testnet

**URL:** <https://forum.flow.com/t/the-emulator-can-run-normally-but-an-error-is-reported-in-testnet/2548>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [November 24, 2021, 1:45am UTC](https://forum.flow.com/t/the-emulator-can-run-normally-but-an-error-is-reported-in-testnet/2548 "2021-11-24T01:45:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.flow.com/u/ben1)\
**Post date:** [November 24, 2021, 1:45am UTC](https://forum.flow.com/t/the-emulator-can-run-normally-but-an-error-is-reported-in-testnet/2548/1 "2021-11-24T01:45:32Z")

</div>

I have a piece of code that can run normally in the emulator, but an error is reported in testnet

```
pub resource somename{

    destroy () {

            emit completed(
                address: self.owner?.address!
            )

    }

```

The code is omitted, and the error is this line “address: self.owner?.address!”

❌ Transaction Error  
[Error Code: 1101] cadence runtime error Execution failed:  
error: unexpectedly found nil while forcing an Optional value

Who can help me see what’s wrong? thank you!

---

<div class="post-metadata">

**Author:** ![bastian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/bastian/32/183_2.png) [@bastian](https://forum.flow.com/u/bastian)\
**Post date:** [November 24, 2021, 1:50am UTC](https://forum.flow.com/t/the-emulator-can-run-normally-but-an-error-is-reported-in-testnet/2548/2 "2021-11-24T01:50:02Z")

</div>

There was a breaking change in the last release of Cadence, see [https://github.com/onflow/cadence/releases/tag/v0.20.0](https://github.com/onflow/cadence/releases/tag/v0.20.0). The `owner` field behaviour was fixed, it is now only set when the resource is in storage.

The emulator has not been updated yet, but will be shortly.

---

<div class="post-metadata">

**Author:** ![ben1](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@ben1](https://forum.flow.com/u/ben1)\
**Post date:** [November 24, 2021, 2:31am UTC](https://forum.flow.com/t/the-emulator-can-run-normally-but-an-error-is-reported-in-testnet/2548/3 "2021-11-24T02:31:19Z")

</div>

It was just updated, Thank you!
