Commit 444dbeb4 by eguven Committed by Oliver Woodman

Fix NPE in FakeDataSource.close()

If open() fails because of the file isn't available then fakeData is null.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160249214
parent 410228ac
......@@ -199,7 +199,7 @@ public final class FakeDataSource implements DataSource {
Assertions.checkState(opened);
opened = false;
uri = null;
if (currentSegmentIndex < fakeData.segments.size()) {
if (fakeData != null && currentSegmentIndex < fakeData.segments.size()) {
Segment current = fakeData.segments.get(currentSegmentIndex);
if (current.isErrorSegment() && current.exceptionThrown) {
current.exceptionCleared = true;
......
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