# Need help on error (reading fields) at the endgame

**URL:** <https://forum.makecode.com/t/need-help-on-error-reading-fields-at-the-endgame/31128>\
**Category:** Help\
**Created:** [October 11, 2024, 8:49pm UTC](https://forum.makecode.com/t/need-help-on-error-reading-fields-at-the-endgame/31128 "2024-10-11T20:49:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darcia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darcia/32/14145_2.png) [@Darcia](https://forum.makecode.com/u/Darcia)\
**Post date:** [October 11, 2024, 8:49pm UTC](https://forum.makecode.com/t/need-help-on-error-reading-fields-at-the-endgame/31128/1 "2024-10-11T20:49:04Z")

</div>

Hello, here is the github to try it: [https://github.com/t3vall/campjeunes](https://github.com/t3vall/campjeunes)

I have an issue when I reach the end of my game. I have this: cannot read properties of undefined (reading ‘fields’), when my condition of end the game is meet during a dialogue.  
What can I do to avoid this ?

---

<div class="post-metadata">

**Author:** ![Darcia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darcia/32/14145_2.png) [@Darcia](https://forum.makecode.com/u/Darcia)\
**Post date:** [October 12, 2024, 8:02pm UTC](https://forum.makecode.com/t/need-help-on-error-reading-fields-at-the-endgame/31128/2 "2024-10-12T20:02:49Z")

</div>

Is it because of this: (Joueur.tileKindAt(TileDirection.Right, assets.tile`tileMur16`) ?

---

<div class="post-metadata">

**Author:** ![Darcia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/darcia/32/14145_2.png) [@Darcia](https://forum.makecode.com/u/Darcia)\
**Post date:** [October 14, 2024, 2:19am UTC](https://forum.makecode.com/t/need-help-on-error-reading-fields-at-the-endgame/31128/3 "2024-10-14T02:19:06Z")

</div>

I think it was about my function appuisBtnAsc() which was always activated when I didn’t need them, now I added specific trigger for its activation. and there is no more Errors.  
But I don’t know why.
