1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 01:39:18 +02:00

fixed NPE in third-party code

This commit is contained in:
Nikolay Pultsin 2015-04-28 17:02:20 +01:00
parent a9e29adb6a
commit 7be10c91db

View file

@ -1497,10 +1497,13 @@ public class FileChooserActivity extends Activity {
} }
break; break;
case DirectoriesOnly: case DirectoriesOnly:
if(((File)getLocation()).canWrite()){ {
final File file = (File)getLocation();
if (file != null && file.canWrite()) {
returnPath = getLocation().getAbsolutePath(); returnPath = getLocation().getAbsolutePath();
} }
break; break;
}
case FilesAndDirectories: case FilesAndDirectories:
if(files == null || files.isEmpty()){ if(files == null || files.isEmpty()){
returnPath = getLocation().getAbsolutePath(); returnPath = getLocation().getAbsolutePath();