Skip to content

Commit

Permalink
fix: set description to undefined if decode fails (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
therishidesai authored Nov 20, 2024
1 parent 8ab9f8c commit bc78f9c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/karp/catalog/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ export function decodeVideo(o: unknown): o is Video {
const obj = o as Partial<Video>
if (!decodeTrack(obj.track)) return false
if (typeof obj.codec !== "string") return false
if (typeof obj.description !== "string") return false

obj.description = Hex.decode(obj.description)
obj.description = obj.description && typeof obj.description === "string" ? Hex.decode(obj.description) : undefined

return true
}

0 comments on commit bc78f9c

Please sign in to comment.