Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Oct 10, 2024
1 parent 9e6266a commit aedf05f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/next/src/server/lib/patch-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,15 @@ function createPatchedFetcher(
const nextRevalidate = pendingResponse
.then((res) => res.clone())
.finally(() => {
// If the pending revalidate is not present in the store, then
// we have nothing to delete.
if (!staticGenerationStore.pendingRevalidates?.[cacheKey]) {
return
}
if (cacheKey) {
// If the pending revalidate is not present in the store, then
// we have nothing to delete.
if (!staticGenerationStore.pendingRevalidates?.[cacheKey]) {
return
}

delete staticGenerationStore.pendingRevalidates[cacheKey]
delete staticGenerationStore.pendingRevalidates[cacheKey]
}
})

// Attach the empty catch here so we don't get a "unhandled promise
Expand Down

0 comments on commit aedf05f

Please sign in to comment.