mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-23 03:21:20 +01:00
Avoid NPE if opening a shared input stream fails
This commit is contained in:
parent
ca39ffbf09
commit
d4e899b6be
|
@ -795,6 +795,8 @@ public class DroidFish extends Activity
|
|||
String fn = Environment.getExternalStorageDirectory() + sep +
|
||||
pgnDir + sep + ".sharedfile.pgn";
|
||||
try (InputStream in = resolver.openInputStream(data)) {
|
||||
if (in == null)
|
||||
throw new IOException("No input stream");
|
||||
FileUtil.writeFile(in, fn);
|
||||
}
|
||||
PGNFile pgnFile = new PGNFile(fn);
|
||||
|
|
Loading…
Reference in New Issue
Block a user