1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 17:59:33 +02:00

fixed possible NPE + formatting

This commit is contained in:
Nikolay Pultsin 2015-08-20 14:42:07 +01:00
parent 68eada9752
commit 95743e388b

View file

@ -1049,12 +1049,13 @@ public class FileChooserActivity extends Activity {
} }
final IFileProvider fileProvider = mFileProvider; final IFileProvider fileProvider = mFileProvider;
if (fileProvider == null) { final IFile location = getLocation();
if (fileProvider == null || location == null) {
return; return;
} }
IFile dir = fileProvider.fromPath(String IFile dir = fileProvider.fromPath(String
.format("%s/%s", getLocation().getAbsolutePath(), name)); .format("%s/%s", location.getAbsolutePath(), name));
if (dir.mkdir()) { if (dir.mkdir()) {
Dlg.toast(FileChooserActivity.this, getString(R.string.afc_msg_done), Dlg._LengthShort); Dlg.toast(FileChooserActivity.this, getString(R.string.afc_msg_done), Dlg._LengthShort);
setLocation(getLocation(), null); setLocation(getLocation(), null);