# ModalJS - Index was out of range exception with Fuse 0.36.1

**URL:** <https://forums.fusetools.com/t/modaljs-index-was-out-of-range-exception-with-fuse-0-36-1/6433>\
**Category:** General\
**Created:** [May 6, 2017, 2:02pm UTC](https://forums.fusetools.com/t/modaljs-index-was-out-of-range-exception-with-fuse-0-36-1/6433 "2017-05-06T14:02:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leandro\_Sehnem\_Borto](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/leandro_sehnem_borto/32/87_2.png) [@Leandro\_Sehnem\_Borto](https://forums.fusetools.com/u/Leandro_Sehnem_Borto)\
**Post date:** [May 6, 2017, 2:02pm UTC](https://forums.fusetools.com/t/modaljs-index-was-out-of-range-exception-with-fuse-0-36-1/6433/1 "2017-05-06T14:02:02Z")

</div>

When I try to run this ModaJS.uno code:

```auto
Modal.showModal(
                    "Oops :(",
                    errorMessage,
                    ["I got it"],
                    function (buttonPressed) {
                        //debug_log("Got callback with " + buttonPressed);
                    });

```

from [https://github.com/bolav/fuse-modalview](https://github.com/bolav/fuse-modalview) (.uno file: [https://github.com/bolav/fuse-modalview/blob/master/ModalJS.uno](https://github.com/bolav/fuse-modalview/blob/master/ModalJS.uno)) under `Fuse 0.36.1` version, I get this exception

```auto
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  at Fuse.Scripting.V8.Context.ThrowPendingExceptions () <0x1b7638a8 + 0x0003f> in <filename unknown>:0 
  at Fuse.Scripting.V8.Function.Call (System.Object[] args) <0x1b765950 + 0x0029f> in <filename unknown>:0 
  at Fuse.Reactive.FunctionMirror+CallClosure.Call () <0x1b7e8dd0 + 0x002e1> in <filename unknown>:0 
  at Fuse.Reactive.ThreadWorker.RunInner () <0x1b761578 + 0x0039f> in <filename unknown>:0 

```

It was working very well two months ago (with `Fuse 0.34`). Maybe its a version issue…

Any suggestion?

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [May 8, 2017, 7:29am UTC](https://forums.fusetools.com/t/modaljs-index-was-out-of-range-exception-with-fuse-0-36-1/6433/2 "2017-05-08T07:29:26Z")

</div>

Hi Leandro,

the problem is clearly with the community package. Because of that, there’s two suggestions:

1. Open the compiled project in Android Studio and debug it there (should give you exact line where the problem occurs, then you can fix the corresponding code in ModalJS.uno). You can launch Android Studio by running `uno build -adebug -tandroid` in project root.
2. Submit an [issue on the repo](https://github.com/bolav/fuse-modalview/issues) and then very politely approach @bolav on slack community.

---

<div class="post-metadata">

**Author:** ![mitesh](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mitesh](https://forums.fusetools.com/u/mitesh)\
**Post date:** [May 23, 2017, 11:38am UTC](https://forums.fusetools.com/t/modaljs-index-was-out-of-range-exception-with-fuse-0-36-1/6433/3 "2017-05-23T11:38:17Z")

</div>

We just recently fixed this.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [May 23, 2017, 2:06pm UTC](https://forums.fusetools.com/t/modaljs-index-was-out-of-range-exception-with-fuse-0-36-1/6433/4 "2017-05-23T14:06:48Z")

</div>

Mitesh, would it be possible for you to share the solution?
