Add a sanity check to avoid bad references, close #77
This commit is contained in:
parent
1090783f91
commit
e08a46f0c6
1 changed files with 4 additions and 1 deletions
|
@ -609,7 +609,10 @@ function preprocessFeed(feed: FeedViewPost[]): FeedViewPostWithThreadMeta[] {
|
||||||
for (const slice of threadSlices) {
|
for (const slice of threadSlices) {
|
||||||
if (slice.length > 3) {
|
if (slice.length > 3) {
|
||||||
reorg.splice(slice.index - removedCount + 1, slice.length - 3)
|
reorg.splice(slice.index - removedCount + 1, slice.length - 3)
|
||||||
|
if (reorg[slice.index - removedCount]) {
|
||||||
|
// ^ sanity check
|
||||||
reorg[slice.index - removedCount]._isThreadChildElided = true
|
reorg[slice.index - removedCount]._isThreadChildElided = true
|
||||||
|
}
|
||||||
removedCount += slice.length - 3
|
removedCount += slice.length - 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue