DroidFish: Check File.renameTo() return value.

This commit is contained in:
Peter Osterlund
2012-01-01 10:40:00 +00:00
parent 04a0b68f1a
commit a1fdce1942

View File

@@ -371,7 +371,8 @@ public class PGNFile {
copyData(fileReader, fileWriter, fileReader.length() - gi.endPos); copyData(fileReader, fileWriter, fileReader.length() - gi.endPos);
fileReader.close(); fileReader.close();
fileWriter.close(); fileWriter.close();
tmpFile.renameTo(fileName); if (!tmpFile.renameTo(fileName))
throw new IOException();
Toast.makeText(context, R.string.game_saved, Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.game_saved, Toast.LENGTH_SHORT).show();
return true; return true;
} catch (IOException e) { } catch (IOException e) {