Skip to content

Commit

Permalink
Handle saving data better. Closes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Fireplace committed Apr 14, 2017
1 parent 4f92f97 commit 7eddd3e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ object DeadStackData {

private def saveToFile() {
try {
if(!data.exists)
if(!data.createNewFile) {
System.out.println("Error: Nether Essence was unable to save dead stack data.")
return
}
val out: ObjectOutputStream = new ObjectOutputStream(new FileOutputStream(data))
out.writeObject(instance)
out.close()
Expand Down

0 comments on commit 7eddd3e

Please sign in to comment.