UBERF-8324: Fix null in external sync and todos (#6777)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-10-02 12:46:05 +07:00 committed by GitHub
parent 473e57d328
commit 47d14885e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View File

@ -700,10 +700,12 @@ export class PullRequestSyncManager extends IssueSyncManagerBase implements DocS
const approvedOrChangesRequested = new Map<Ref<Person>, PullRequestReviewState>()
const reviewStates = new Map<Ref<Person>, PullRequestReviewState[]>()
const sortedReviews: (Review & { date: number })[] = external.reviews.nodes.map((it) => ({
...it,
date: new Date(it.updatedAt ?? it.submittedAt ?? it.createdAt).getTime()
}))
const sortedReviews: (Review & { date: number })[] = external.reviews.nodes
.filter((it) => it != null)
.map((it) => ({
...it,
date: new Date(it.updatedAt ?? it.submittedAt ?? it.createdAt).getTime()
}))
for (const it of external.latestReviews.nodes) {
if (sortedReviews.some((qt) => it.id === qt.id)) {

View File

@ -346,7 +346,7 @@ export async function syncDerivedDocuments<T extends { url: string }> (
})
const processed = new Set<Ref<DocSyncInfo>>()
const _docs = docs(ext)
const _docs = docs(ext).filter((it) => it != null)
for (const r of _docs) {
const existing = childDocsOfClass.find((it) => it.url.toLowerCase() === r.url.toLowerCase())
if (existing === undefined) {