Skip to content

Commit 3095f44

Browse files
authored
fix parsing of params when already object (#146)
1 parent 1138b56 commit 3095f44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/injected/injectWalletGuard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const addWalletGuardProxy = (provider: any) => {
136136
return Reflect.apply(target, thisArg, args);
137137
}
138138

139-
const params = JSON.parse(request.params[1]);
139+
const params = typeof request.params[1] === 'string' ? JSON.parse(request.params[1]) : request.params[1];
140140
log.info({ params }, 'Request being sent');
141141

142142
let signer: string = params[0];
@@ -318,7 +318,7 @@ const addWalletGuardProxy = (provider: any) => {
318318
return Reflect.apply(target, thisArg, args);
319319
}
320320

321-
const params = JSON.parse(request.params[1]);
321+
const params = typeof request.params[1] === 'string' ? JSON.parse(request.params[1]) : request.params[1];
322322
log.info({ params }, 'Request being sent');
323323

324324
let signer: string = params[0];

0 commit comments

Comments
 (0)