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
This commit is contained in:
parent
410228acb8
commit
444dbeb4c4
@ -199,7 +199,7 @@ public final class FakeDataSource implements DataSource {
|
|||||||
Assertions.checkState(opened);
|
Assertions.checkState(opened);
|
||||||
opened = false;
|
opened = false;
|
||||||
uri = null;
|
uri = null;
|
||||||
if (currentSegmentIndex < fakeData.segments.size()) {
|
if (fakeData != null && currentSegmentIndex < fakeData.segments.size()) {
|
||||||
Segment current = fakeData.segments.get(currentSegmentIndex);
|
Segment current = fakeData.segments.get(currentSegmentIndex);
|
||||||
if (current.isErrorSegment() && current.exceptionThrown) {
|
if (current.isErrorSegment() && current.exceptionThrown) {
|
||||||
current.exceptionCleared = true;
|
current.exceptionCleared = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user