cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon MacDonald (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-2093) NullPointerException when attaching image from Gallery that contains spaces in the path
Date Fri, 21 Dec 2012 17:31:14 GMT

    [ https://issues.apache.org/jira/browse/CB-2093?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13538232#comment-13538232
] 

Simon MacDonald commented on CB-2093:
-------------------------------------

[~brian] it looks like he is using the stock Gallery app based on the uri "content://com.google.android.gallery3d.provider/picasa/item/5080798897969217026"
but he may be getting an image from Picasa. I've tested this scenario but not for the device
and version of Android David is using.

Looking at the code:

String url = filename.replace(" ", "%20");

the NullPointerException can only be caused by filename being null. Which means the previous
call to FileUtils.getRealPathFromURI() returns the null. Looking at that code I'm willing
to bet the searching of the DB fails to yield anything.
                
> 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

Mime
View raw message