]> cat aescling's git repositories - mastodon.git/commitdiff
Fix "Cannot read property" on missing status (#3322)
authorunarist <m.unarist@gmail.com>
Fri, 26 May 2017 12:07:48 +0000 (21:07 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 26 May 2017 12:07:48 +0000 (14:07 +0200)
I've found this issue when I clicked replies to muted user on the timeline.

Properties I've removed in here were added with lazy loading using
IntersectionObserver (8e4d1cba), but those statuses are not need to be
tracked anyway because it will be rendered as only empty div.

app/javascript/mastodon/components/status.js

index 5405ddfd1d2d9309e6156aa9cdcaee05098261bb..a9f9c1b6b97392c9eccde04a610775ca1ed96dd0 100644 (file)
@@ -111,7 +111,7 @@ class Status extends ImmutablePureComponent {
     const { isHidden } = this.state;
 
     if (status === null) {
-      return <div ref={this.handleRef} data-id={status.get('id')} />;
+      return null;
     }
 
     if (isIntersecting === false && isHidden) {