EddyVerbruggen / nativescript-email

:envelope: NativeScript plugin for opening draft e-mails
MIT License
47 stars 15 forks source link

Cannot read property 'toString' of null when running on android 5 #26

Closed leocrawf closed 6 years ago

leocrawf commented 6 years ago

When I use a device or emulator running android 5 I get the following exception:

An uncaught Exception occurred on "main" thread. com.tns.NativeScriptException: Calling js method onTouch failed

Error calling module function

Error calling module function

TypeError: Cannot read property 'toString' of null File: "file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js, line: 178, column: 21

StackTrace: Frame: function:'_cleanAttachmentFolder', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 178, column: 22 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 5, column: 3 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 6, column: 3 Frame: function:'require', file:'', line: 1, column: 266 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/contact/contact-page.js', line: 10, column: 15 Frame: function:'require', file:'', line: 1, column: 266 Frame: function:'_loop_1', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 60, column: 22 Frame: function:'global.loadModule', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 68, column: 23 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 82, column: 27 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 108, column: 29 Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 213, column: 28 Frame: function:'onGoToPage', file:'file:///data/data/org.nativescript.someappname/files/app/anonlanding/anonlanding-page.js', line: 145, column: 17 Frame: function:'_executeCallback', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 283, column: 27 Frame: function:'TapAndDoubleTapGestureListenerImpl.onSingleTapUp', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 25, column: 17 Frame: function:'GesturesObserver.androidOnTouchEvent', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 229, column: 41 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 34, column: 29 Frame: function:'TouchListenerImpl.onTouch', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 33, column: 22

TypeError: Cannot read property 'toString' of null File: ", line: 1, column: 265

StackTrace: Frame: function:'_cleanAttachmentFolder', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 178, column: 22 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 5, column: 3 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 6, column: 3 Frame: function:'require', file:'', line: 1, column: 266 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/contact/contact-page.js', line: 10, column: 15 Frame: function:'require', file:'', line: 1, column: 266 Frame: function:'_loop_1', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 60, column: 22 Frame: function:'global.loadModule', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 68, column: 23 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 82, column: 27 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 108, column: 29 Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 213, column: 28 Frame: function:'onGoToPage', file:'file:///data/data/org.nativescript.someappname/files/app/anonlanding/anonlanding-page.js', line: 145, column: 17 Frame: function:'_executeCallback', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 283, column: 27 Frame: function:'TapAndDoubleTapGestureListenerImpl.onSingleTapUp', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 25, column: 17 Frame: function:'GesturesObserver.androidOnTouchEvent', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 229, column: 41 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 34, column: 29 Frame: function:'TouchListenerImpl.onTouch', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 33, column: 22

TypeError: Cannot read property 'toString' of null File: "file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js, line: 229, column: 40

StackTrace: Frame: function:'_cleanAttachmentFolder', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 178, column: 22 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 5, column: 3 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/nativescript-email/email.js', line: 6, column: 3 Frame: function:'require', file:'', line: 1, column: 266 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/contact/contact-page.js', line: 10, column: 15 Frame: function:'require', file:'', line: 1, column: 266 Frame: function:'_loop_1', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 60, column: 22 Frame: function:'global.loadModule', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/globals/globals.js', line: 68, column: 23 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 82, column: 27 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 108, column: 29 Frame: function:'FrameBase.navigate', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 213, column: 28 Frame: function:'onGoToPage', file:'file:///data/data/org.nativescript.someappname/files/app/anonlanding/anonlanding-page.js', line: 145, column: 17 Frame: function:'_executeCallback', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 283, column: 27 Frame: function:'TapAndDoubleTapGestureListenerImpl.onSingleTapUp', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 25, column: 17 Frame: function:'GesturesObserver.androidOnTouchEvent', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/gestures/gestures.js', line: 229, column: 41 Frame: function:'', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 34, column: 29 Frame: function:'TouchListenerImpl.onTouch', file:'file:///data/data/org.nativescript.someappname/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 33, column: 22

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
at com.tns.gen.java.lang.Object_frnal_ts_helpers_l58_c38__TouchListenerImpl.onTouch(Object_frnal_ts_helpers_l58_c38__TouchListenerImpl.java:13)
at android.view.View.dispatchTouchEvent(View.java:8465)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2399)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2092)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2405)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2106)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2369)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1719)
at android.app.Activity.dispatchTouchEvent(Activity.java:2742)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2330)
at android.view.View.dispatchPointerEvent(View.java:8666)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4123)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3989)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3680)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3571)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3737)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3597)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3563)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3571)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3544)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5807)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5781)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5752)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5897)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:143)
at android.os.Looper.loop(Looper.java:122)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
leocrawf commented 6 years ago

I fixed the issue: https://github.com/leocrawf/nativescript-email/commit/d3ec6ffdf48e8ed564deaf73772f456f9c1555b8

EddyVerbruggen commented 6 years ago

@leocrawf Thanks, I created a PR from your fork and merged it 💪