Commit 88daaa88 by Oliver Woodman

Fix NPE if source is released having never been prepared.

parent 837090e8
......@@ -234,7 +234,7 @@ public final class FrameworkSampleSource implements SampleSource {
@Override
public void release() {
Assertions.checkState(remainingReleaseCount > 0);
if (--remainingReleaseCount == 0) {
if (--remainingReleaseCount == 0 && extractor != null) {
extractor.release();
extractor = null;
}
......
......@@ -313,7 +313,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
@Override
public void release() {
Assertions.checkState(remainingReleaseCount > 0);
if (--remainingReleaseCount == 0) {
if (--remainingReleaseCount == 0 && loader != null) {
loader.release();
loader = null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment