Skip to content
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

AdVpnThread.stopThread() on a null object reference #360

Closed
soenkegissel opened this issue Oct 13, 2019 · 2 comments
Closed

AdVpnThread.stopThread() on a null object reference #360

soenkegissel opened this issue Oct 13, 2019 · 2 comments
Labels

Comments

@soenkegissel
Copy link

The belows stacktrace occures when the Lists are getting updated and you start and stop the service by button click.

java.lang.NullPointerException: Attempt to invoke virtual method 'void org.jak_linux.dns66.vpn.AdVpnThread.stopThread()' on a null object reference
at org.jak_linux.dns66.vpn.AdVpnService.restartVpnThread(AdVpnService.java:232)
at org.jak_linux.dns66.vpn.AdVpnService.reconnect(AdVpnService.java:248)
at org.jak_linux.dns66.vpn.AdVpnService.connectivityChanged(AdVpnService.java:305)
at org.jak_linux.dns66.vpn.AdVpnService.handleMessage(AdVpnService.java:283)
at org.jak_linux.dns66.vpn.AdVpnService$MyHandler.handleMessage(AdVpnService.java:58)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

@soenkegissel
Copy link
Author

In AdVpnService line 255 is the vpnThread = null; really needed?
If you call line 264 stopSelf(); the vpnThread should be garbage collected as well.

@julian-klode
Copy link
Owner

I'm not going to try and find out if it's needed, it's there, so it probably is. Because this whole business is super messy with cycles and weird references in android system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants