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

Crash / NPE when viewing a trip with missing line style #16

Closed
Paspartout opened this issue Nov 13, 2013 · 7 comments
Closed

Crash / NPE when viewing a trip with missing line style #16

Paspartout opened this issue Nov 13, 2013 · 7 comments
Assignees
Labels
bug 🐞 A functional defect or unexpected behavior.

Comments

@Paspartout
Copy link
Contributor

Steps to reproduce

  1. Open Liberario, go to your favorite trips tab, and select / view one of your trips
  2. Go back and select another favorite trip
  3. Crash / NPE

Logcat

I/ActivityManager(  537): START u0 {cmp=de.grobox.liberario/.TripsActivity (has extras)} from pid 2900
D/dalvikvm(  537): GC_FOR_ALLOC freed 3895K, 32% free 23390K/34208K, paused 101ms, total 102ms
W/InputMethodManagerService(  537): Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@41d3f4c0 (uid=10095 pid=2900)
D/PullToRefresh( 2900): Setting Padding. L: 0, T: 0, R: 0, B: 0
D/PullToRefresh( 2900): addView: TableLayout
D/AndroidRuntime( 2900): Shutting down VM
W/dalvikvm( 2900): threadid=1: thread exiting with uncaught exception (group=0x41510700)
E/AndroidRuntime( 2900): FATAL EXCEPTION: main
E/AndroidRuntime( 2900): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.grobox.liberario/de.grobox.liberario.TripsActivity}: java.lang.NullPointerException
E/AndroidRuntime( 2900):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2350)
E/AndroidRuntime( 2900):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2400)
E/AndroidRuntime( 2900):    at android.app.ActivityThread.access$600(ActivityThread.java:153)
E/AndroidRuntime( 2900):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)
E/AndroidRuntime( 2900):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2900):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2900):    at android.app.ActivityThread.main(ActivityThread.java:5295)
E/AndroidRuntime( 2900):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2900):    at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime( 2900):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
E/AndroidRuntime( 2900):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
E/AndroidRuntime( 2900):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2900): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 2900):    at de.grobox.liberario.TripsActivity.addLineBox(TripsActivity.java:276)
E/AndroidRuntime( 2900):    at de.grobox.liberario.TripsActivity.addLineBox(TripsActivity.java:303)
E/AndroidRuntime( 2900):    at de.grobox.liberario.TripsActivity.addLineBox(TripsActivity.java:295)
E/AndroidRuntime( 2900):    at de.grobox.liberario.TripsActivity.addTrips(TripsActivity.java:225)
E/AndroidRuntime( 2900):    at de.grobox.liberario.TripsActivity.addTrips(TripsActivity.java:322)
E/AndroidRuntime( 2900):    at de.grobox.liberario.TripsActivity.onCreate(TripsActivity.java:86)
E/AndroidRuntime( 2900):    at android.app.Activity.performCreate(Activity.java:5248)
E/AndroidRuntime( 2900):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 2900):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2304)
E/AndroidRuntime( 2900):    ... 11 more
W/ActivityManager(  537):   Force finishing activity de.grobox.liberario/.TripsActivity
W/ActivityManager(  537):   Force finishing activity de.grobox.liberario/.MainActivity
I/auditd  ( 3024): Starting up
E/auditd  ( 3024): Failed on audit_set_pid with error: Protocol not supported
I/auditd  ( 3024): Exiting
W/DropBoxManagerService(  537): Dropping: data_app_crash (1771 > 0 bytes)

BTW: Thanks for Liberario, its awesome :D

@grote
Copy link
Owner

grote commented Nov 13, 2013

Thanks for the great bug report! :)

However, I don't think it can be reproduced as stated. Looks more like one of your favorite trips contains a line that has no color defined. Could you please provide the trip and the transport network?

@ghost ghost assigned grote Nov 13, 2013
@Paspartout
Copy link
Contributor Author

Thanks for your fast response and you were right.

I am using the DB(Deutsche Bahn) Provider for my local public transport, which usually works fine.
In this one case here the trip shows a special / rare product called AST(Anrufsammeltaxi), which seems not to be handled by your app / public transport enabler.

Maybe it is a good idea to provide a default color to the apps line boxes, in case there is no color provided by your app / public transport enabler.

@grote
Copy link
Owner

grote commented Nov 13, 2013

Do you have an example for a trip that includes this AST? It does not have to be the real trip you are using in your area. Any example that causes the issue works for me testing a fix and a default color.

@Paspartout
Copy link
Contributor Author

Yes, here you go:

  • Provider: DB (As mentioned above)
  • Start: Naumburg (Hessen) Bahnhof (Just type Naumburg Bahnhof, and it should be suggested)
  • End: Höringhausen Mitte, Waldeck (Hessen)
  • Date: Today(Any other date should work to)
  • Time: 22:00(Any other time should work to)

If you are about to add the colors for the AST here is an its icon.

@grote
Copy link
Owner

grote commented Nov 14, 2013

I now handled the missing AST style to prevent crashes and passed the style issue to upstream.

@grote grote closed this as completed in 8ee84dc Nov 14, 2013
@schildbach
Copy link

Yes, I guess that's the right fix. Lines are not guaranteed to have a style.

@Paspartout
Copy link
Contributor Author

Okay thanks for that really fast fix. I am looking forward to the next version of Liberario :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 A functional defect or unexpected behavior.
Projects
None yet
Development

No branches or pull requests

3 participants