# 无法读取未定义的属性（读取 'id'）

**URL:** <https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416>\
**Category:** Bug\
**Tags:** whos-online\
**Created:** [2025年一月28日 16:37 UTC](https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416 "2025-01-28T16:37:39Z")\
**Posts on this page:** 1\
**Showing post:** 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:** [2025年一月28日 16:37 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://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/9/f/b/9fb7f1ca3dc3da4ccadbbe45b54bfdf689e95030.png)

重现步骤：

- 启用 `whos_online_avatar_indicator_topic_lists` 设置
- 转到主题列表
- 创建一个新主题
- 填写标题，将焦点放在文本区域，一秒钟后，错误发生。

[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)

看起来 `topic.lastPosterUser` 在此上下文中为 null。

---

_[View the full topic](https://meta.discourse.org/t/cannot-read-properties-of-undefined-reading-id/349416)._
