X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fcom%2Fstoutner%2Fprivacybrowser%2Factivities%2FMainWebViewActivity.java;h=772196d4b94184335c722b9dee92dd243eeb8169;hp=e8b6c0a6db5fab0e64299820eb9031af8cc7a40b;hb=7c08413564ba6a9eb15e86f6ed1860c55cbdf9b2;hpb=833e68e01a23035ccbab1e69b123d530061be4ce diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java index e8b6c0a6..772196d4 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java +++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java @@ -874,6 +874,7 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook MenuItem selectedFontSizeMenuItem; // Prepare the font size title and current size menu item. + //noinspection DuplicateBranchesInSwitch switch (fontSize) { case 25: fontSizeTitle = getString(R.string.font_size) + " - " + getString(R.string.twenty_five_percent); @@ -2906,11 +2907,14 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook // Instantiate the file name helper. FileNameHelper fileNameHelper = new FileNameHelper(); - // Convert the file name URI to a file name path. - String fileNamePath = fileNameHelper.convertUriToFileNamePath(data.getData()); + // Get the file path if it isn't null. + if (data.getData() != null) { + // Convert the file name URI to a file name path. + String fileNamePath = fileNameHelper.convertUriToFileNamePath(data.getData()); - // Set the file name path as the text of the file name edit text. - fileNameEditText.setText(fileNamePath); + // Set the file name path as the text of the file name edit text. + fileNameEditText.setText(fileNamePath); + } } } break;