Skip to content

Commit f2b77fd

Browse files
fix: ensure non-null resolver value in Editor (#566)
1 parent 462d368 commit f2b77fd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/funny-shoes-begin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@craftjs/core': patch
3+
---
4+
5+
Ensure non-null resolver prop value in Editor component

packages/core/src/editor/Editor.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const Editor: React.FC<React.PropsWithChildren<Partial<Options>>> = ({
1818
// we do not want to warn the user if no resolver was supplied
1919
if (options.resolver !== undefined) {
2020
invariant(
21-
typeof options.resolver === 'object' && !Array.isArray(options.resolver),
21+
typeof options.resolver === 'object' &&
22+
!Array.isArray(options.resolver) &&
23+
options.resolver !== null,
2224
ERROR_RESOLVER_NOT_AN_OBJECT
2325
);
2426
}

0 commit comments

Comments
 (0)