From 64a5e9a1ded9527e2d80a609666d4bbc28ed1570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Mon, 16 Oct 2017 23:09:39 +0200 Subject: [PATCH] workaround for null status --- app/javascript/glitch/components/status/container.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/javascript/glitch/components/status/container.js b/app/javascript/glitch/components/status/container.js index da2771c0b61..24261e7633e 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;