Skip to content

Commit

Permalink
fix: 修复深度代理值被设置为null时出错的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuntian001 committed Jul 18, 2023
1 parent 417b49f commit 1d23622
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const getColorLuma = function (color: string) {
export const proxyValue = <T extends Record<string | number, any> | any[]>(value: T, update: () => void): T => {
return new Proxy<T>(value, {
get: function (obj, prop) {
if (typeof obj[prop as keyof T] === 'object') {
if (obj[prop as keyof T] && typeof obj[prop as keyof T] === 'object') {
return proxyValue(obj[prop as keyof T] as T, update);
}
return obj[prop as keyof T];
Expand Down

0 comments on commit 1d23622

Please sign in to comment.