mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 09:02:41 +01:00
DroidFish: Check File.renameTo() return value.
This commit is contained in:
@@ -371,7 +371,8 @@ public class PGNFile {
|
||||
copyData(fileReader, fileWriter, fileReader.length() - gi.endPos);
|
||||
fileReader.close();
|
||||
fileWriter.close();
|
||||
tmpFile.renameTo(fileName);
|
||||
if (!tmpFile.renameTo(fileName))
|
||||
throw new IOException();
|
||||
Toast.makeText(context, R.string.game_saved, Toast.LENGTH_SHORT).show();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user