# ScriptContext through client scope does not return project, but does in Perspective

**URL:** <https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [August 2, 2022, 10:01pm UTC](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604 "2022-08-02T22:01:11Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [August 4, 2022, 3:25pm UTC](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604/21 "2022-08-04T15:25:08Z")

</div>

> [@pturmel](#):
>
> used `HashMap<String,WeakRef<GatewayScriptModule>>`.

What happens here when the module is dropped, would you just end up with empty “projectName:null” pairs?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 4, 2022, 3:38pm UTC](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604/22 "2022-08-04T15:38:39Z")

</div>

You get a weakref containing a null. When you dereference to that null, construct a new instance and replace the current.

[Previous page](https://forum.inductiveautomation.com/t/scriptcontext-through-client-scope-does-not-return-project-but-does-in-perspective/62604.md?page=1)
