Skip to content

Commit

Permalink
Null check
Browse files Browse the repository at this point in the history
  • Loading branch information
oed committed Mar 25, 2024
1 parent 1596e70 commit f20f39c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/signing.ts
Expand Up @@ -86,7 +86,7 @@ export function decode(encoded: EncodedJWS): DagJWS {
}
}

function replaceCIDs(data: Record<string, any> | any): Record<string, any> | any {
function replaceCIDs(data: any): any {
if (typeof data === 'string') {
if (data.startsWith('ipfs://')) {
return CID.parse(data.slice(7))
Expand All @@ -105,7 +105,7 @@ function replaceCIDs(data: Record<string, any> | any): Record<string, any> | any
}

function isObject(data: any): data is Record<string, any> {
return typeof data === 'object'
return typeof data === 'object' && data !== null
}

function payloadToJSON(data: Uint8Array): any {
Expand Down

0 comments on commit f20f39c

Please sign in to comment.