about summary refs log tree commit diff
path: root/app/javascript/glitch
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/glitch')
-rw-r--r--app/javascript/glitch/components/status/container.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/javascript/glitch/components/status/container.js b/app/javascript/glitch/components/status/container.js
index da2771c0b..24261e763 100644
--- a/app/javascript/glitch/components/status/container.js
+++ b/app/javascript/glitch/components/status/container.js
@@ -102,6 +102,16 @@ const makeMapStateToProps = () => {
   const mapStateToProps = (state, ownProps) => {
 
     let status = getStatus(state, ownProps.id);
+
+    if(status === null) {
+      console.error(`ERROR! NULL STATUS! ${ownProps.id}`);
+      // work-around: find first good status
+      for (let k of state.get('statuses').keys()) {
+        status = getStatus(state, k);
+        if (status !== null) break;
+      }
+    }
+
     let reblogStatus = status.get('reblog', null);
     let account = undefined;
     let prepend = undefined;