Skip to content

Commit

Permalink
fix: set description to undefined if decode fails
Browse files Browse the repository at this point in the history
  • Loading branch information
therishidesai committed Nov 19, 2024
1 parent 8e10b00 commit 505dd36
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 ? Hex.decode(obj.description) : undefined

return true
}

0 comments on commit 505dd36

Please sign in to comment.