From 237e30df4ff55ece8a2033d68d78c735ef4ff7c1 Mon Sep 17 00:00:00 2001 From: Nikolay Pultsin Date: Fri, 7 Aug 2015 03:30:44 +0200 Subject: [PATCH] fixed possible NPE --- .../pals/android/lib/ui/filechooser/FileChooserActivity.java | 5 +++++ 1 file changed, 5 insertions(+) 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 e87c8d340..e5f121460 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 @@ -456,6 +456,11 @@ public class FileChooserActivity extends Activity { @Override public void onBackPressed() { IFile currentLoc = getLocation(); + if (currentLoc == null || myHistory == null) { + super.onBackPressed(); + return; + } + IFile preLoc = null; while (currentLoc.equalsToPath(preLoc = mHistory.prevOf(currentLoc))) mHistory.remove(preLoc);