Fixed crash when no sdcard installed

This commit is contained in:
PeratX 2017-05-30 09:12:49 +08:00
parent 443eda1642
commit 4efd48a05d

View File

@ -134,10 +134,12 @@ public class Configurations {
public void save() {
try {
FileWriter writer = new FileWriter(file);
new Gson().toJson(this, writer);
writer.flush();
writer.close();
if (file != null) {
FileWriter writer = new FileWriter(file);
new Gson().toJson(this, writer);
writer.flush();
writer.close();
}
} catch (IOException e) {
Logger.logException(e);
}