Skip to content

Commit

Permalink
Use the non-external files dir for chat logs when the external one is…
Browse files Browse the repository at this point in the history
… unavailable
  • Loading branch information
MCMrARM committed Dec 1, 2017
1 parent 2dd8557 commit 74ecca3
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -48,7 +48,9 @@ public static ServerConfigManager getInstance(Context context) {
public ServerConfigManager(Context context) {
mContext = context;
mServersPath = new File(context.getFilesDir(), SERVERS_PATH);
mServerLogsPath = new File(context.getExternalFilesDir(null), SERVER_LOGS_PATH);
File externalFilesDir = context.getExternalFilesDir(null);
mServerLogsPath = externalFilesDir != null ? new File(externalFilesDir, SERVER_LOGS_PATH)
: new File(context.getFilesDir(), SERVER_LOGS_PATH);
mServerLogsPath.mkdirs();
loadServers();
}
Expand Down

0 comments on commit 74ecca3

Please sign in to comment.