]> cat aescling's git repositories - mastodon.git/commitdiff
workaround for null status
authorOndřej Hruška <ondra@ondrovo.com>
Mon, 16 Oct 2017 21:09:39 +0000 (23:09 +0200)
committerOndřej Hruška <ondra@ondrovo.com>
Mon, 16 Oct 2017 21:09:39 +0000 (23:09 +0200)
app/javascript/glitch/components/status/container.js

index da2771c0b610e83fb9d478572626b4dc78cbad02..24261e7633eddee5d495461ac4bef2449a14c476 100644 (file)
@@ -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;
This page took 0.024808 seconds and 3 git commands to generate.