diff options
author | David Yip <yipdw@member.fsf.org> | 2017-10-18 17:01:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 17:01:31 -0500 |
commit | 90770f6d59624f8f1d8e43fa9f86ab92f130ee8b (patch) | |
tree | 4b5bbdb043ea1c5a4f0338be7b23df6b4ebc3c67 /app | |
parent | c75665127878f41af2547b12b8723963c04d305b (diff) | |
parent | 64a5e9a1ded9527e2d80a609666d4bbc28ed1570 (diff) |
Merge pull request #185 from glitch-soc/fix-null-status
workaround for null status
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/glitch/components/status/container.js | 10 |
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; |