mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-13 01:22:41 +01:00
DroidFish: Fixed crash when receiving an incorrect PGN intent.
This commit is contained in:
@@ -737,8 +737,7 @@ public class DroidFish extends Activity
|
|||||||
PGNFile pgnFile = new PGNFile(fn);
|
PGNFile pgnFile = new PGNFile(fn);
|
||||||
long fileLen = FileUtil.getFileLength(fn);
|
long fileLen = FileUtil.getFileLength(fn);
|
||||||
Pair<GameInfoResult,ArrayList<GameInfo>> gi = pgnFile.getGameInfo(this, null, 2);
|
Pair<GameInfoResult,ArrayList<GameInfo>> gi = pgnFile.getGameInfo(this, null, 2);
|
||||||
int nGames = gi.second.size();
|
if ((fileLen > 1024 * 1024) || (gi.first == GameInfoResult.OK && gi.second.size() > 1)) {
|
||||||
if ((fileLen > 1024 * 1024) || (gi.first == GameInfoResult.OK && nGames > 1)) {
|
|
||||||
filename = fn;
|
filename = fn;
|
||||||
} else {
|
} else {
|
||||||
in = new FileInputStream(fn);
|
in = new FileInputStream(fn);
|
||||||
|
|||||||
Reference in New Issue
Block a user