Skip to content

Commit f7ef465

Browse files
committed
Ensure typedSignatureHash receives a non-empty array
1 parent 514afde commit f7ef465

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ export {
531531
*/
532532
function typedSignatureHash<T extends MessageTypes>(typedData: TypedData<T>): Buffer {
533533
const error = new Error('Expect argument to be non-empty array')
534-
if (typeof typedData !== 'object' || !('length' in typedData)) throw error
534+
if (typeof typedData !== 'object' || !('length' in typedData) || !typedData.length) throw error
535535

536536
const data = typedData.map(function (e) {
537537
return e.type === 'bytes' ? ethUtil.toBuffer(e.value) : e.value

0 commit comments

Comments
 (0)