Skip to content

Fix for issue #212#213

Merged
bramp merged 2 commits intobramp:masterfrom
yermak:master
Mar 31, 2020
Merged

Fix for issue #212#213
bramp merged 2 commits intobramp:masterfrom
yermak:master

Conversation

@yermak
Copy link
Copy Markdown
Contributor

@yermak yermak commented Mar 31, 2020

This fix implements chapters support by FFProbe, issue #212

Copy link
Copy Markdown
Owner

@bramp bramp left a comment

Choose a reason for hiding this comment

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

Thanks!


} finally {
p.destroy();
if (p != null) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can p be null here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

well, processBuilder should not return null, however, try to pass non-configured smaple to probe() method and you get NPE in destroy, as tests setUp is quite fragile, once you misconfigure it (what I obviously done in the first run) - mock could return null for process then the test crashes hiding real reason - and that's become a puzzle.
Formally, I agree check is not needed for production code and code should not contain code for tests as it makes it more tricky to support. Ideally, setUp/before needs to be tuned to make more robbust and crash on incorrect file rather then return null.

@yermak yermak requested a review from bramp March 31, 2020 18:08
Copy link
Copy Markdown
Owner

@bramp bramp left a comment

Choose a reason for hiding this comment

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

Thanks!

@bramp bramp merged commit a10e384 into bramp:master Mar 31, 2020
@yermak
Copy link
Copy Markdown
Contributor Author

yermak commented Mar 31, 2020

@bramp, that was quick. Thanks!

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