# Crash when trying to use a Tab.Var as a cache

**URL:** <https://resource.dopus.com/t/crash-when-trying-to-use-a-tab-var-as-a-cache/57929>\
**Category:** Help & Support\
**Created:** [December 1, 2025, 8:27pm UTC](https://resource.dopus.com/t/crash-when-trying-to-use-a-tab-var-as-a-cache/57929 "2025-12-01T20:27:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [December 1, 2025, 8:27pm UTC](https://resource.dopus.com/t/crash-when-trying-to-use-a-tab-var-as-a-cache/57929/1 "2025-12-01T20:27:28Z")

</div>

ID : 663

I was testing a script to find a workaround for the issue described [here](https://resource.dopus.com/t/access-to-involved-items-in-scriptcolumndata/57758).

Basically the idea was:

- When the script runs for the first item, check if this `Tab.Var` exists to grab a `map` of items with their respective values. If it doesn't, grab all items from the tab (if any) and process them in batch.
- Save the values to the `Tab.Var`.
- When `OnBeforeFolderChange()` triggers, delete the `Tab.Var`.

But Opus sometimes crashes when `OnBeforeFolderChange()` runs while the columns are still being populated.

I guess that sometimes the var gets deleted while it's still being used to calculate values, because `OnBeforeFolderChange()` can trigger simultaneously.

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [December 1, 2025, 9:38pm UTC](https://resource.dopus.com/t/crash-when-trying-to-use-a-tab-var-as-a-cache/57929/2 "2025-12-01T21:38:27Z")

</div>

Nevermind, I found what the real issue was, and it's not related to what I originally thought. Sorry for the trouble.

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [December 2, 2025, 2:48am UTC](https://resource.dopus.com/t/crash-when-trying-to-use-a-tab-var-as-a-cache/57929/3 "2025-12-02T02:48:49Z")

</div>

Still it'd be nice to fix the crash - if you can give me a script that reproduces it that'd be great.

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [December 2, 2025, 3:17am UTC](https://resource.dopus.com/t/crash-when-trying-to-use-a-tab-var-as-a-cache/57929/4 "2025-12-02T03:17:07Z")

</div>

Jon, sorry, I already fixed the error so I don't have that script anymore.  
But I can tell you what it was.  
Basically, I forgot the "map" I was using to store values was a JScript object. The crash happens when you load it from a `Tab.Var` (saving it is fine; the error occurs when loading/deleting if the object has properties that are also objects/null) or any other `Var` I guess. The object was produced dynamically from a JSON, so it had mixed types.  
Switching it to an Opus Map fixed it.
