# Cannot read properties of undefined (reading 'id')

**URL:** https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416
**Category:** Bug
**Tags:** whos-online
**Created:** [January 28, 2025, 4:37pm UTC](https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416 "2025-01-28T16:37:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [January 28, 2025, 4:37pm UTC](https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416/1 "2025-01-28T16:37:39Z")

</div>

![This image shows a UI interface for a software development management tool with a sidebar on the left and a dialog box on the right for creating a new topic. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/7/c/d/7cd74644b9262e8d5de31d217ee8627c2c1c8b3e.png)

![image](https://global.discourse-cdn.com/meta/original/4X/9/f/b/9fb7f1ca3dc3da4ccadbbe45b54bfdf689e95030.png)

To reproduce:

- Enable `whos_online_avatar_indicator_topic_lists` setting
- Go to the topic lists
- Create a new topic
- Fill in the title, focus the textarea, and one second later, the error happens.

[https://github.com/discourse/discourse-whos-online/blob/main/assets/javascripts/discourse/api-initializers/intitialize-whos-online-indicators.js#L76-L84](https://github.com/discourse/discourse-whos-online/blob/main/assets/javascripts/discourse/api-initializers/intitialize-whos-online-indicators.js#L76-L84)

It looks like `topic.lastPosterUser` is null in this context.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 30, 2025, 10:22am UTC](https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416/2 "2025-01-30T10:22:29Z")

</div>

Thanks @Arkshine for the excellent bug report 👏

It will be fixed by

[https://github.com/discourse/discourse-whos-online/pull/119](https://github.com/discourse/discourse-whos-online/pull/119)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 3, 2025, 7:00am UTC](https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416/3 "2025-02-03T07:00:08Z")

</div>

This topic was automatically closed after 3 days. New replies are no longer allowed.
