diff --git a/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java b/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java index 1b5f2b1e..04688ce0 100644 --- a/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java +++ b/app/src/main/java/com/nutomic/syncthingandroid/activities/WebGuiActivity.java @@ -19,6 +19,7 @@ import android.webkit.HttpAuthHandler; import android.webkit.SslErrorHandler; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.Toast; import com.nutomic.syncthingandroid.R; import com.nutomic.syncthingandroid.service.Constants; @@ -206,13 +207,18 @@ public class WebGuiActivity extends StateDialogActivity } /** - * Reads the SyncthingService.HTTPS_CERT_FILE Ca Cert key and loads it in memory + * Reads the SyncthingService.HTTPS_CERT_FILE Ca Cert key and loads it in memory */ private void loadCaCert() { InputStream inStream = null; + File httpsCertFile = Constants.getHttpsCertFile(this); + if (!httpsCertFile.exists()) { + Toast.makeText(WebGuiActivity.this, R.string.config_file_missing, Toast.LENGTH_LONG).show(); + finish(); + return; + } try { - File httpsCertPath = Constants.getHttpsCertFile(this); - inStream = new FileInputStream(httpsCertPath); + inStream = new FileInputStream(httpsCertFile); CertificateFactory cf = CertificateFactory.getInstance("X.509"); mCaCert = (X509Certificate) cf.generateCertificate(inStream); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6c0e7ff6..d30df4b6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -583,6 +583,9 @@ Please report any problems you encounter via Github. Failed to create config file + + A config file crucial to operation is missing + Camera