From 3e341f4220d71b6d0abda0d0b4eed81538bd9293 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 4 Jan 2016 17:05:01 -0800 Subject: Fix crash when auto resetting the cache location --- .../java/github/daneren2005/dsub/fragments/SettingsFragment.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java index 9853e046..11de6aee 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SettingsFragment.java @@ -664,8 +664,11 @@ public class SettingsFragment extends PreferenceCompatFragment implements Shared SharedPreferences.Editor editor = prefs.edit(); editor.putString(Constants.PREFERENCES_KEY_CACHE_LOCATION, defaultPath); editor.commit(); - cacheLocation.setSummary(defaultPath); - cacheLocation.setText(defaultPath); + + if(cacheLocation != null) { + cacheLocation.setSummary(defaultPath); + cacheLocation.setText(defaultPath); + } } // Clear download queue. -- cgit v1.2.3