Skip to content

Conversation

@MythodeaLoL
Copy link

@MythodeaLoL MythodeaLoL commented Jul 2, 2021

This fix the error:

AttributeError: 'NoneType' object has no attribute 'start'

Explaining the error:

It is caused because the caption has a blank value, a blank caption with no text, this causes the default code that joins the subtitles to go into error, as it cannot join a received None value, with an existing String value, and ends up breaking the subtitle conversion.

Problem example (DFXP/SMPTE xml):

<p region='pop1' style='basic' begin='01:55:05:08' end='01:55:11:14' tts:origin='17.5% 84.66%' tts:extent='62.5% 5.33%'>Subtitle End</p>
<p region='pop2' style='basic' begin='01:55:05:08' end='01:55:11:14' tts:origin='50% 84.66%' tts:extent='0% 5.33%'></p>

FloridaStream added 2 commits July 1, 2021 20:48
This fix the error: 
AttributeError: 'NoneType' object has no attribute 'start'

Explaining the error:
It is caused because the caption has a blank value, a blank caption with no text, this causes the default code that joins the subtitles to go into error, as it cannot join a received None value, with an existing String value, and ends up breaking the subtitle conversion.

Problem example (DFXP/SMPTE xml):
```<p region='pop1' style='basic' begin='01:55:05:08' end='01:55:11:14' tts:origin='17.5% 84.66%' tts:extent='62.5% 5.33%'>Subtitle End</p>
<p region='pop2' style='basic' begin='01:55:05:08' end='01:55:11:14' tts:origin='50% 84.66%' tts:extent='0% 5.33%'></p>```
Fix merge of an empty caption
Copy link
Contributor

@ana-nichifor ana-nichifor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for your contribution! The modifications look good to me. Please add a unit test with the example you provided and it's good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants