OSDN Git Service

Guard against MountService throwing NPE.
authorJeff Sharkey <jsharkey@android.com>
Thu, 8 Jan 2015 22:00:13 +0000 (14:00 -0800)
committerJeff Sharkey <jsharkey@android.com>
Thu, 8 Jan 2015 22:00:15 +0000 (14:00 -0800)
Fall through to below logic and return null instead of crashing the
entire app.  We already tell developers the value may be null.

Bug: 17781998
Change-Id: I05dce90ae6bc547d74f8c16d30b3dc7888a937fe

core/java/android/app/ContextImpl.java

index 2df35df..2ef046d 100644 (file)
@@ -2419,7 +2419,7 @@ class ContextImpl extends Context {
                         int res = -1;
                         try {
                             res = mount.mkdirs(getPackageName(), dir.getAbsolutePath());
-                        } catch (RemoteException e) {
+                        } catch (Exception ignored) {
                         }
                         if (res != 0) {
                             Log.w(TAG, "Failed to ensure directory: " + dir);