You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2015/06/17 21:33:30 UTC
cordova-plugin-file git commit: CB-9068: Lollipop represents missing
filesystems as null. Adding null check to workaround.
Repository: cordova-plugin-file
Updated Branches:
refs/heads/master c0171447c -> 9d8db841d
CB-9068: Lollipop represents missing filesystems as null. Adding null check to workaround.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/9d8db841
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/9d8db841
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/9d8db841
Branch: refs/heads/master
Commit: 9d8db841d62691058c674cbade321e34534ba6f3
Parents: c017144
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Jun 17 12:33:16 2015 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Wed Jun 17 12:33:25 2015 -0700
----------------------------------------------------------------------
src/android/LocalFilesystem.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/9d8db841/src/android/LocalFilesystem.java
----------------------------------------------------------------------
diff --git a/src/android/LocalFilesystem.java b/src/android/LocalFilesystem.java
index 7f5431c..2c77596 100644
--- a/src/android/LocalFilesystem.java
+++ b/src/android/LocalFilesystem.java
@@ -412,8 +412,9 @@ public class LocalFilesystem extends Filesystem {
private boolean isPublicDirectory(String absolutePath) {
// TODO: should expose a way to scan app's private files (maybe via a flag).
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ // Lollipop has a bug where SD cards are null.
for (File f : context.getExternalMediaDirs()) {
- if (absolutePath.startsWith(f.getAbsolutePath())) {
+ if(f != null && absolutePath.startsWith(f.getAbsolutePath())) {
return true;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org