From 6aa8c07ab36c8100d92a27717b5fc8f2ffab09cd Mon Sep 17 00:00:00 2001 From: serso Date: Tue, 12 Jan 2016 14:29:24 +0100 Subject: [PATCH] Don't file if file doesn't exist --- .../java/org/solovyev/android/calculator/history/History.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/org/solovyev/android/calculator/history/History.java b/app/src/main/java/org/solovyev/android/calculator/history/History.java index a1e8dcc5..e906a6ca 100644 --- a/app/src/main/java/org/solovyev/android/calculator/history/History.java +++ b/app/src/main/java/org/solovyev/android/calculator/history/History.java @@ -121,6 +121,9 @@ public class History { @Nonnull private static List loadStates(@Nonnull File file) { + if (!file.exists()) { + return Collections.emptyList(); + } final CharSequence json = FileLoader.load(file); if (TextUtils.isEmpty(json)) { return Collections.emptyList();