cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Did (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CB-7106) NullPointerException at App startup if SD-Card is absent
Date Wed, 09 Jul 2014 13:37:05 GMT

     [ https://issues.apache.org/jira/browse/CB-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Did closed CB-7106.
-------------------

    Resolution: Not a Problem

Problem existed with version 1.2.0 of the file plugin. On master it is already fixed.

> NullPointerException at App startup if SD-Card is absent
> --------------------------------------------------------
>
>                 Key: CB-7106
>                 URL: https://issues.apache.org/jira/browse/CB-7106
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin File
>    Affects Versions: 3.5.0
>         Environment: Android 4.0.3, Industrial Handheld, using cordova-plugin-file
>            Reporter: Did
>
> in the Android implementation of cordova-plugin-file an exception is thrown when the
device has no sd-card:
> 07-09 06:56:32.400: E/PluginManager(2877): Uncaught exception from plugin
> 07-09 06:56:32.400: E/PluginManager(2877): java.lang.NullPointerException
> 07-09 06:56:32.400: E/PluginManager(2877): 	at org.apache.cordova.file.FileUtils.requestAllPaths(FileUtils.java:866)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at org.apache.cordova.file.FileUtils.execute(FileUtils.java:348)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at org.apache.cordova.PluginManager.execHelper(PluginManager.java:242)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at org.apache.cordova.PluginManager.exec(PluginManager.java:227)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at org.apache.cordova.CordovaChromeClient.onJsPrompt(CordovaChromeClient.java:227)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:600)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at android.os.Handler.dispatchMessage(Handler.java:99)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at android.os.Looper.loop(Looper.java:137)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at java.lang.reflect.Method.invokeNative(Native
Method)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at java.lang.reflect.Method.invoke(Method.java:511)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
> 07-09 06:56:32.400: E/PluginManager(2877): 	at dalvik.system.NativeStart.main(Native
Method)
> the documentation for context.getExternal... (i.e.: context.getExternalFilesDir, context.getExternalCacheDir())
> tells there is NULL returned if no external storage is available
> this leads to a problem for calls like this:
> context.getExternalFilesDir(null).getParentFile();
> context.getExternalFilesDir(null) returns null and there is a call to null.getParentFile();
which throws NullPointerException



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message