mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 09:02:41 +01:00
DroidFish: Fixed crash due to division by zero.
Fixed crash that could happen when reading a PGN file at the same time as another process was writing to the file.
This commit is contained in:
@@ -337,7 +337,7 @@ public class PGNFile {
|
||||
gi = null;
|
||||
break;
|
||||
}
|
||||
final int newPercent = (int)(filePos * 100 / fileLen);
|
||||
final int newPercent = fileLen == 0 ? 0 : (int)(filePos * 100 / fileLen);
|
||||
if (newPercent > percent) {
|
||||
percent = newPercent;
|
||||
if (progress != null) {
|
||||
|
||||
Reference in New Issue
Block a user