RRO tests: fix potential NPE

Bug: 17765434

Check for null before closing streams.

Change-Id: I651785649575725009f270d4d8eb5f4bf90952a6
This commit is contained in:
Mårten Kongstad
2014-11-07 10:45:49 +01:00
committed by Zoran Jovanovic
parent 97b5df7643
commit 840796a3c2

View File

@@ -225,8 +225,12 @@ public abstract class OverlayBaseTest extends AndroidTestCase {
reader = new BufferedReader(new InputStreamReader(input));
actual = reader.readLine();
} finally {
reader.close();
input.close();
if (reader != null) {
reader.close();
}
if (input != null) {
input.close();
}
}
final String no = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +