mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
fixed possible NPE
This commit is contained in:
parent
6b3a3d8813
commit
237e30df4f
1 changed files with 5 additions and 0 deletions
|
@ -456,6 +456,11 @@ public class FileChooserActivity extends Activity {
|
||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
IFile currentLoc = getLocation();
|
IFile currentLoc = getLocation();
|
||||||
|
if (currentLoc == null || myHistory == null) {
|
||||||
|
super.onBackPressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IFile preLoc = null;
|
IFile preLoc = null;
|
||||||
while (currentLoc.equalsToPath(preLoc = mHistory.prevOf(currentLoc)))
|
while (currentLoc.equalsToPath(preLoc = mHistory.prevOf(currentLoc)))
|
||||||
mHistory.remove(preLoc);
|
mHistory.remove(preLoc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue