From 7be10c91db4a28ac9f3a64942b485d6f2b82bd85 Mon Sep 17 00:00:00 2001 From: Nikolay Pultsin Date: Tue, 28 Apr 2015 17:02:20 +0100 Subject: [PATCH] fixed NPE in third-party code --- .../pals/android/lib/ui/filechooser/FileChooserActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/third-party/android-filechooser/code/src/group/pals/android/lib/ui/filechooser/FileChooserActivity.java b/third-party/android-filechooser/code/src/group/pals/android/lib/ui/filechooser/FileChooserActivity.java index 48d685c71..a58dbcfe8 100755 --- a/third-party/android-filechooser/code/src/group/pals/android/lib/ui/filechooser/FileChooserActivity.java +++ b/third-party/android-filechooser/code/src/group/pals/android/lib/ui/filechooser/FileChooserActivity.java @@ -1497,10 +1497,13 @@ public class FileChooserActivity extends Activity { } break; case DirectoriesOnly: - if(((File)getLocation()).canWrite()){ + { + final File file = (File)getLocation(); + if (file != null && file.canWrite()) { returnPath = getLocation().getAbsolutePath(); } break; + } case FilesAndDirectories: if(files == null || files.isEmpty()){ returnPath = getLocation().getAbsolutePath();