Skip to content

Commit 0fb6c00

Browse files
committed
check null object
1 parent 6a5879b commit 0fb6c00

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const createProxyHandler = () => ({
2424
get(target, key) {
2525
this.recordUsage(target, key);
2626
const val = target[key];
27-
if (typeof val !== 'object') {
27+
if (typeof val !== 'object' || val === null) {
2828
return val;
2929
}
3030
const proto = Object.getPrototypeOf(val);
@@ -80,8 +80,8 @@ export const isDeepChanged = (
8080
assumeChangedIfNotAffected,
8181
) => {
8282
if (origObj === nextObj) return false;
83-
if (typeof origObj !== 'object') return true;
84-
if (typeof nextObj !== 'object') return true;
83+
if (typeof origObj !== 'object' || origObj === null) return true;
84+
if (typeof nextObj !== 'object' || nextObj === null) return true;
8585
const used = affected.get(origObj);
8686
if (!used) return !!assumeChangedIfNotAffected;
8787
if (cache) {

0 commit comments

Comments
 (0)