# this.activeNodes\[id\] returns null

**URL:** <https://discourse.nodered.org/t/this-activenodes-id-returns-null/12641>\
**Category:** General\
**Created:** [27 June 2019 03:21 UTC](https://discourse.nodered.org/t/this-activenodes-id-returns-null/12641 "2019-06-27T03:21:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauldeng](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pauldeng/32/574_2.png) [@pauldeng](https://discourse.nodered.org/u/pauldeng)\
**Post date:** [27 June 2019 03:21 UTC](https://discourse.nodered.org/t/this-activenodes-id-returns-null/12641/1 "2019-06-27T03:21:27Z")

</div>

Hi all,

I am developing my custom node.

After I redeploy application via the editor, my node sometimes does not send out the messages as expected.

By looking at the code, my custom node calls this.send(msg) and it sometimes ended up with undefined value returned from "node = this.\_flow.getNode(this.\_wire);" in send() in Node.js file.

By stepping into the getNode(), I saw a comment above the "return this.activeNodes[id];" it has comments saying "// During a stop/restart, activeNodes could be null for this id".

What should I do in my custom node to avoid this null/undefined value return?

Thanks a lot.

Cheers,  
Paul

---

<div class="post-metadata">

**Author:** ![pauldeng](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pauldeng/32/574_2.png) [@pauldeng](https://discourse.nodered.org/u/pauldeng)\
**Post date:** [28 June 2019 05:59 UTC](https://discourse.nodered.org/t/this-activenodes-id-returns-null/12641/2 "2019-06-28T05:59:11Z")

</div>

I fixed my issue.

Because my node was not properly deregistered.
