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);
// 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;