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

NPE when tapping on Invert option Trip Plan #623

Closed
themonki opened this issue Jul 21, 2016 · 1 comment
Closed

NPE when tapping on Invert option Trip Plan #623

themonki opened this issue Jul 21, 2016 · 1 comment
Labels
Milestone

Comments

@themonki
Copy link
Contributor

themonki commented Jul 21, 2016

Summary:

When open trip planning and try to "Invert" say null pointer object, I think because I don't chosen a destination.

07-21 08:52:04.895 20894-20894/org.agencyy.android D/HomeActivity: onOptionsItemSelected
07-21 08:52:05.741 20894-20894/org.agencyy.android I/Timeline: Timeline: Activity_launch_request id:org.agencyy.android time:7858806
07-21 08:52:05.761 20894-20943/org.agencyy.android I/GAv4: Dry run enabled. Would have sent hit: ht=1469109125759, _v=ma9.0.80, a=1185166847, aid=org.agencyy.android, an=Agency Y, av=2.1.0, cd=HomeActivity, cd1=MIO (CALI-CO), cid=2d256152-1bef-4517-b749-56dffb40d456, ea=button_press, ec=ui_action, el=Clicked Trip Plan Link, sr=720x1184, t=event, tid=UA-XXXXXXX-XX, ul=es-co, v=1
07-21 08:52:05.761 20894-20943/org.agencyy.android I/GAv4: Dry run enabled. Would have sent hit: ht=1469109125759, _v=ma9.0.80, a=1547401621, aid=org.agencyy.android, an=Agency Y, av=2.1.0, cd=HomeActivity, cd1=MIO (CALI-CO), cid=2d256152-1bef-4517-b749-56dffb40d456, ea=button_press, ec=ui_action, el=Clicked Trip Plan Link, sr=720x1184, t=event, tid=UA-YYYYYYY-YY, ul=es-co, v=1
07-21 08:52:06.082 20894-20894/org.agencyy.android D/LocationServicesCallbck: GoogleApiClient.onConnected
07-21 08:52:06.164 20894-20894/org.agencyy.android I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@71eb450 time:7859229
07-21 08:52:06.266 20894-20894/org.agencyy.android D/NavDrawerFragment: Saving position = 0
07-21 08:52:12.892 20894-20894/org.agencyy.android W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
07-21 08:52:14.805 20894-20894/org.agencyy.android D/AndroidRuntime: Shutting down VM
07-21 08:52:14.806 20894-20894/org.agencyy.android E/AndroidRuntime: FATAL EXCEPTION: main
     Process: org.agencyy.android, PID: 20894
     java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.onebusaway.android.directions.util.CustomAddress.toString()' on a null object reference
         at org.onebusaway.android.ui.TripPlanFragment.reverseTrip(TripPlanFragment.java:416)
         at org.onebusaway.android.ui.TripPlanFragment.onOptionsItemSelected(TripPlanFragment.java:308)
         at android.support.v4.app.Fragment.performOptionsItemSelected(Fragment.java:2085)
         at android.support.v4.app.FragmentManagerImpl.dispatchOptionsItemSelected(FragmentManager.java:2163)
         at android.support.v4.app.FragmentController.dispatchOptionsItemSelected(FragmentController.java:304)
         at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:409)
         at android.support.v7.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:189)
         at android.support.v7.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:100)
         at android.support.v7.app.AppCompatDelegateImplV7.onMenuItemSelected(AppCompatDelegateImplV7.java:663)
         at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:811)
         at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:152)
         at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:958)
         at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:948)
         at android.support.v7.view.menu.MenuPopupHelper.onItemClick(MenuPopupHelper.java:191)
         at android.widget.AdapterView.performItemClick(AdapterView.java:310)
         at android.widget.AbsListView.performItemClick(AbsListView.java:1145)
         at android.widget.AbsListView$PerformClick.run(AbsListView.java:3066)
         at android.widget.AbsListView$3.run(AbsListView.java:3903)
         at android.os.Handler.handleCallback(Handler.java:739)
         at android.os.Handler.dispatchMessage(Handler.java:95)
         at android.os.Looper.loop(Looper.java:224)
         at android.app.ActivityThread.main(ActivityThread.java:5526)
         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)

Steps to reproduce:

  1. Open the app and go to "Plan a Trip (beta)".
  2. Go to options, and select "Invert"

Expected behavior:

My origin(from) what say "Current Location" change to destiny (to).

Observed behavior:

Crash

Device and Android version:

Xperia Z3 Compact (D5803)
Manufacturer Sony
Android version Android 6.0.1
RAM (MB) 2048
Screen size 720 × 1280
Screen density (dpi) 320
OpenGL ES version 3.0
Native platform armeabi-v7a
CPU make Qualcomm
CPU model MSM8974AC
Google Play Services 9.0.83

Screenshots:

@barbeau
Copy link
Member

barbeau commented Jul 21, 2016

@themonki Thanks, good catch!

@sdjacobs Could you please work on this?

@barbeau barbeau added this to the v2.1.x milestone Jul 21, 2016
@barbeau barbeau added the bug label Jul 21, 2016
@barbeau barbeau changed the title Crash by Null Pointer on Invert option Trip Plan NPE when tapping on Invert option Trip Plan Jul 21, 2016
sdjacobs added a commit to camsys/onebusaway-android that referenced this issue Jul 21, 2016
- Solution: blank CustomAddress when no origin or destination
- Also removed tight coupling between TripPlanFragment and TripPlanActivity
barbeau added a commit that referenced this issue Jul 21, 2016
Fix #623 - NPE when reverse and no origin/destination
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