[ https://issues.apache.org/jira/browse/CB-2093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13549811#comment-13549811 ]
Joe Bowser commented on CB-2093: -------------------------------- OK, This is totally bizzare. We can get the image path from a file with spaces, but we can't get the mime type if there's spaces in the path. FileUtils.getMimeType completely fails when there's spaces in the path. I'm not entirely sure what to do here, but this is just completely bizzare. > NullPointerException when attaching image from Gallery that contains spaces > in the path > --------------------------------------------------------------------------------------- > > Key: CB-2093 > URL: https://issues.apache.org/jira/browse/CB-2093 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 2.3.0 > Environment: Tested Cordova 2.3.0 RC2 on Galaxy Nexus 7 with Android > 4.2.1 > Reporter: David Omer > Assignee: Joe Bowser > Priority: Critical > > When trying to use camera.getPicture with source=SAVEDPHOTOALBUM and > destination=DATA_URL, I'm getting the following error: > 12-20 15:22:56.256: W/dalvikvm(2089): threadid=1: thread exiting with > uncaught exception (group=0x4122d930) > 12-20 15:22:56.266: E/AndroidRuntime(2089): FATAL EXCEPTION: main > 12-20 15:22:56.266: E/AndroidRuntime(2089): java.lang.RuntimeException: > Failure delivering result ResultInfo{who=null, request=49, result=-1, > data=Intent { > dat=content://com.google.android.gallery3d.provider/picasa/item/5080798897969217026 > flg=0x1 }} to activity > {com.steton.mobileauditor/com.steton.mobileauditor.App}: > java.lang.NullPointerException > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.app.ActivityThread.deliverResults(ActivityThread.java:3319) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.app.ActivityThread.handleSendResult(ActivityThread.java:3362) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.app.ActivityThread.access$1100(ActivityThread.java:141) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.os.Handler.dispatchMessage(Handler.java:99) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.os.Looper.loop(Looper.java:137) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.app.ActivityThread.main(ActivityThread.java:5039) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > java.lang.reflect.Method.invokeNative(Native Method) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > java.lang.reflect.Method.invoke(Method.java:511) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > dalvik.system.NativeStart.main(Native Method) > 12-20 15:22:56.266: E/AndroidRuntime(2089): Caused by: > java.lang.NullPointerException > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > org.apache.cordova.FileUtils.getMimeType(FileUtils.java:989) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > org.apache.cordova.CameraLauncher.onActivityResult(CameraLauncher.java:397) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > org.apache.cordova.DroidGap.onActivityResult(DroidGap.java:806) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.app.Activity.dispatchActivityResult(Activity.java:5293) > 12-20 15:22:56.266: E/AndroidRuntime(2089): at > android.app.ActivityThread.deliverResults(ActivityThread.java:3315) > 12-20 15:22:56.266: E/AndroidRuntime(2089): ... 11 more -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira