Skip to content

Commit 3c4770d

Browse files
committed
Fixed cache handler nullref
1 parent 1f17c59 commit 3c4770d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

packages/nextjs-cache-handler/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/nextjs-cache-handler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"next",
1919
"redis"
2020
],
21-
"version": "2.0.0-canary9",
21+
"version": "2.0.0-canary10",
2222
"type": "module",
2323
"license": "MIT",
2424
"description": "Next.js cache handlers",

packages/nextjs-cache-handler/src/handlers/cache-handler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,15 @@ export class CacheHandler implements NextCacheHandler {
105105
*
106106
* // after the Next.js called the onCreation hook
107107
* console.log(CacheHandler.name);
108-
* // Output: "@neshca/cache-handler with 2 Handlers"
108+
* // Output: "cache-handler with 2 Handlers"
109109
* ```
110110
*/
111111
static get name(): string {
112112
if (CacheHandler.#cacheListLength === undefined) {
113-
return "@neshca/cache-handler is not configured yet";
113+
return "cache-handler is not configured yet";
114114
}
115115

116-
return `@neshca/cache-handler with ${CacheHandler.#cacheListLength} Handler${
116+
return `cache-handler with ${CacheHandler.#cacheListLength} Handler${
117117
CacheHandler.#cacheListLength > 1 ? "s" : ""
118118
}`;
119119
}
@@ -643,7 +643,7 @@ export class CacheHandler implements NextCacheHandler {
643643
);
644644
}
645645

646-
const { tags = [], internal_lastModified } = ctx;
646+
const { tags = [], internal_lastModified } = ctx ?? {};
647647

648648
const revalidate = (incrementalCacheValue as CachedFetchValue)?.revalidate;
649649

packages/nextjs-cache-handler/src/handlers/cache-handler.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ declare class CacheHandler implements NextCacheHandler {
283283
*
284284
* // after the Next.js called the onCreation hook
285285
* console.log(CacheHandler.name);
286-
* // Output: "@neshca/cache-handler with 2 Handlers"
286+
* // Output: "cache-handler with 2 Handlers"
287287
* ```
288288
*/
289289
static get name(): string;

0 commit comments

Comments
 (0)