New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NullPointerException: cs == null in AppUtils #1066

Open
ape-report opened this Issue Mar 9, 2018 · 0 comments

Comments

1 participant
@ape-report

ape-report commented Mar 9, 2018

An exception is triggered on Nexus 5 Android 6.0.1.

Uri.parse(url).getHost() returns null if url is mailto:dot@dotat.at.

To reproduce, simply click the user id fanf2.

I have also tried this in Java.

public class Test {
    public static void main(String []args) {
        System.out.println(java.net.URI.create("mailto:dot@dotat.at").getHost());
    }
}
// java.lang.NullPointerException: cs == null
// 	at java.lang.String.contains(String.java:1483)
// 	at io.github.hidroh.materialistic.AppUtils.openWebUrlExternal(AppUtils.java:104)
// 	at io.github.hidroh.materialistic.AppUtils$1.onTouch(AppUtils.java:165)
// 	at android.view.View.dispatchTouchEvent(View.java:9290)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
// 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
// 	at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
// 	at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
// 	at android.app.Activity.dispatchTouchEvent(Activity.java:2765)
// 	at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
// 	at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
// 	at android.view.View.dispatchPointerEvent(View.java:9514)
// 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4230)
// 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4096)
// 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
// 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
// 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
// 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3787)
// 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
// 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3844)
// 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
// 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3695)
// 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3661)
// 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3669)
// 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3642)
// 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5922)
// 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5896)
// 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5857)
// 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6025)
// 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
// 	at android.os.MessageQueue.nativePollOnce(Native Method)
// 	at android.os.MessageQueue.next(MessageQueue.java:323)
// 	at android.os.Looper.loop(Looper.java:135)
// 	at android.app.ActivityThread.main(ActivityThread.java:5417)
// 	at java.lang.reflect.Method.invoke(Native Method)
// 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
// 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment