# VerseRuntimeErrors: "... called on disposed object" when using first element in array

**URL:** <https://forums.unrealengine.com/t/verseruntimeerrors-called-on-disposed-object-when-using-first-element-in-array/840393>\
**Category:** Issues and Bug Reporting\
**Tags:** bug, unreal-editor-for-fortnite, fortnite-creative, bug-report, fortnite\
**Created:** [April 3, 2023, 1:25pm UTC](https://forums.unrealengine.com/t/verseruntimeerrors-called-on-disposed-object-when-using-first-element-in-array/840393 "2023-04-03T13:25:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xaert1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xaert1](https://forums.unrealengine.com/u/Xaert1)\
**Post date:** [April 3, 2023, 1:25pm UTC](https://forums.unrealengine.com/t/verseruntimeerrors-called-on-disposed-object-when-using-first-element-in-array/840393/1 "2023-04-03T13:25:23Z")

</div>

[I made a post about this earlier](https://forums.unrealengine.com/t/creative-prop-moveto-disposed-error-when-called-from-other-verse/837372/6), but didn’t realize what the problem was then. Since then it appears to be a Verse bug with arrays.

Using the following two Verse scripts:

```auto
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }

test_device := class<concrete>(creative_device):
    @editable
    TestArray<public> : []test_device2 = array{test_device2{}}

    OnBegin<override>()<suspends>:void=
        if ( Device := TestArray[1]):
            Device.TestFunction()
        if ( Device := TestArray[0]):
            Device.TestFunction()

```

```auto
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/SpatialMath }

test_device2 := class<concrete>(creative_device):
    @editable
    TestProp<public> : creative_prop = creative_prop{}

    TestFunction<public>():void=
        Print("{TestProp.GetTransform().Translation}")

```

And constructing them in such a way that both the first and second array elements point to the same test\_device2 instance, you can confirm calling the first element causes an error, whereas calling the second element does not:

```auto
LogVerse: Error: VerseRuntimeErrors: GetTransform called on disposed object. Use .IsDisposed[] to check before calling.

```

This also happens when using a for statement.
