firescript / nativescript-contacts

A nativescript module that gives access to the native contact directory.
MIT License
28 stars 32 forks source link

Update existing contact throwing an error (Android Only) #30

Open OPADA-Eng opened 7 years ago

OPADA-Eng commented 7 years ago

Hi, Thanks for your plugin. I have an issue only on Android devices occurs in this line: contact.save(); throw this error:

Error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.net.Uri.getLastPathSegment()' on a null object reference JS: android.content.ContentUris.parseId(ContentUris.java:85) JS: com.tns.Runtime.callJSMethodNative(Native Method) JS: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1021) JS: com.tns.Runtime.callJSMethodImpl(Runtime.java:903) JS: com.tns.Runtime.callJSMethod(Runtime.java:890) JS: com.tns.Runtime.callJSMethod(Runtime.java:874) JS: com.tns.Runtime.callJSMethod(Runtime.java:866) JS: com.tns.NativeScriptActivity.onActivityResult(NativeScriptActivity.java:69) JS: android.app.Activity.dispatchActivityResult(Activity.java:6428) JS: android.app.ActivityThread.deliverResults(ActivityThread.java:3695) JS: android.app.ActivityThread.handleSendResult(ActivityThread.java:3742) JS: android.app.ActivityThread.-wrap16(ActivityThread.java) JS: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) JS: android.os.Handler.dispatchMessage(Handler.java:102) JS: android.os.Looper.loop(Looper.java:148) JS: android.app.ActivityThread.main(ActivityThread.java:5417) JS: java.lang.reflect.Method.invoke(Native Method) JS: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) JS: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

when trying to update an existing contact. I've tested on Android v6.0.0 and 7.0.0 in the attachments bellow test code generate the issue. Thanks in advanced. my-contacts.zip

cfjedimaster commented 5 years ago

I'm seeing this now as well. It seems to save the contact ok but I'm only changing the photo.

Amira-tageldin commented 3 years ago

I am seeing issue now as well :( Did anyone find a solution for this issue?