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

Null pointer exception if long press used without colored pencil #52

Open
jjblum opened this issue Apr 19, 2017 · 1 comment
Open

Null pointer exception if long press used without colored pencil #52

jjblum opened this issue Apr 19, 2017 · 1 comment
Labels

Comments

@jjblum
Copy link
Contributor

jjblum commented Apr 19, 2017

Does not occur if the pencil ever becomes colored. Once it is turned back to black the app will not crash on long press.

AndroidRuntime [E] FATAL EXCEPTION: main
AndroidRuntime [E] Process: com.platypus.android.tablet, PID: 4871
AndroidRuntime [E] java.lang.NullPointerException: Attempt to invoke virtual method 'void
com.platypus.android.tablet.Path.Path.updateRegionPoints()' on a null o
bject reference
AndroidRuntime [E] at com.platypus.android.tablet.TeleOpPanel.invalidate(TeleOpPanel.java:
2721)
AndroidRuntime [E] at com.platypus.android.tablet.TeleOpPanel$7$2.onMapLongClick(TeleOpPan
el.java:689)
AndroidRuntime [E] at com.mapbox.mapboxsdk.maps.MapView$GestureListener.onLongPress(MapVie
w.java:1976)
AndroidRuntime [E] at android.view.GestureDetector.dispatchLongPress(GestureDetector.java:
690)
AndroidRuntime [E] at android.view.GestureDetector.access$200(GestureDetector.java:37)
AndroidRuntime [E] at android.view.GestureDetector$GestureHandler.handleMessage(GestureDet
ector.java:266)
AndroidRuntime [E] at android.os.Handler.dispatchMessage(Handler.java:102)
AndroidRuntime [E] at android.os.Looper.loop(Looper.java:135)
AndroidRuntime [E] at android.app.ActivityThread.main(ActivityThread.java:5484)
AndroidRuntime [E] at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime [E] at java.lang.reflect.Method.invoke(Method.java:372)
AndroidRuntime [E] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteIni
t.java:984)
AndroidRuntime [E] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

@jjblum jjblum added the bug label Apr 19, 2017
@jjblum
Copy link
Contributor Author

jjblum commented Apr 19, 2017

Suggested change:

In TeleOpPanel.invalidate(), make sure boatPath.updateRegionPoints() is inside a check for boatPath != null:

if (boatPath != null)
{
    boatPath.updateRegionPoints();
}
else
{
    return;
}

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

1 participant