mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-17 07:32:09 +00:00
workaround for null status
This commit is contained in:
parent
6cd5b3bbe5
commit
64a5e9a1de
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue