Skip to content

Commit cc24e94

Browse files
committed
Null resource check
1 parent 3aa21ff commit cc24e94

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/net/i2p/crypto/eddsa/math/PrecomputationTestVectors.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,10 @@ public static GroupElement[] getDoublePrecomputation(String fileName) {
6666
BufferedReader file = null;
6767
int row = 0;
6868
try {
69-
file = new BufferedReader(new InputStreamReader(
70-
PrecomputationTestVectors.class.getResourceAsStream(fileName)));
69+
InputStream is = PrecomputationTestVectors.class.getResourceAsStream(fileName);
70+
if (is == null)
71+
throw new IOException("Resource not found: " + fileName);
72+
file = new BufferedReader(new InputStreamReader(is));
7173
String line;
7274
while ((line = file.readLine()) != null) {
7375
if (line.equals(" },")) {

0 commit comments

Comments
 (0)