mirror of
https://github.com/syncthing/syncthing-android.git
synced 2025-01-11 04:25:53 +00:00
Merge pull request #768 from capi/stguiassets-nullpointer
Fix NullPointerException for STGUIASSETS
This commit is contained in:
commit
220917e060
1 changed files with 4 additions and 1 deletions
|
@ -13,6 +13,7 @@ import com.nutomic.syncthingandroid.BuildConfig;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
@ -118,7 +119,9 @@ public class SyncthingRunnable implements Runnable {
|
||||||
// Set home directory to data folder for web GUI folder picker.
|
// Set home directory to data folder for web GUI folder picker.
|
||||||
env.put("HOME", Environment.getExternalStorageDirectory().getAbsolutePath());
|
env.put("HOME", Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||||
env.put("STTRACE", sp.getString("sttrace", ""));
|
env.put("STTRACE", sp.getString("sttrace", ""));
|
||||||
env.put("STGUIASSETS", mContext.getExternalFilesDir(null).getAbsolutePath() + "/gui");
|
File externalFilesDir = mContext.getExternalFilesDir(null);
|
||||||
|
if (externalFilesDir != null)
|
||||||
|
env.put("STGUIASSETS", externalFilesDir.getAbsolutePath() + "/gui");
|
||||||
env.put("STNORESTART", "1");
|
env.put("STNORESTART", "1");
|
||||||
env.put("STNOUPGRADE", "1");
|
env.put("STNOUPGRADE", "1");
|
||||||
if (sp.getBoolean("use_tor", false)) {
|
if (sp.getBoolean("use_tor", false)) {
|
||||||
|
|
Loading…
Reference in a new issue