Skip to content

Commit

Permalink
SCC: Handle non-matched SCC codes in SccWord.get_channel
Browse files Browse the repository at this point in the history
If is_code returns True but _find_code doesn't match the code,
get_channel would crash rather than returning None.
  • Loading branch information
atsampson committed May 13, 2024
1 parent 536f1c8 commit 48747c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/python/ttconv/scc/word.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def is_code(self) -> bool:

def get_channel(self) -> Optional[SccChannel]:
"""Returns the caption channel, if the word is an SCC code"""
if self.is_code():
if isinstance(self.code, SccPreambleAddressCode):
return self.code.get_channel()
return self.code.get_channel(self.value)
return None
if self.code is None:
return None
if isinstance(self.code, SccPreambleAddressCode):
return self.code.get_channel()
return self.code.get_channel(self.value)

0 comments on commit 48747c3

Please sign in to comment.