]> cat aescling's git repositories - mastodon.git/commitdiff
Fix breaks when opening a reply tree in WebUI (#10046)
authorrinsuki <428rinsuki+git@gmail.com>
Thu, 14 Feb 2019 16:03:01 +0000 (01:03 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 14 Feb 2019 16:03:01 +0000 (17:03 +0100)
fix #10045

app/javascript/mastodon/components/status.js

index 386404b574b3bb951a4a4649bf42b8c7be741bdb..3e98d374b83a38602b6ef587380ef612d9259045 100644 (file)
@@ -86,7 +86,7 @@ class Status extends ImmutablePureComponent {
 
   // Track height changes we know about to compensate scrolling
   componentDidMount () {
-    this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status.get('card');
+    this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');
   }
 
   getSnapshotBeforeUpdate () {
@@ -99,7 +99,7 @@ class Status extends ImmutablePureComponent {
 
   // Compensate height changes
   componentDidUpdate (prevProps, prevState, snapshot) {
-    const doShowCard  = !this.props.muted && !this.props.hidden && this.props.status.get('card');
+    const doShowCard  = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');
     if (doShowCard && !this.didShowCard) {
       this.didShowCard = true;
       if (snapshot !== null && this.props.updateScrollBottom) {