Crash: LyftButton#displayCost referring to CostEstimate#estimated_cost_cents_min which is null starting Aug 25, 2021

Open
#26 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
android, java
Domain
mobile

Research direction

Start at LyftButton.java:191, where displayCost crashes while processing the CostEstimate response, and inspect the response handling around LyftButtonCallManager.java:184. Reproduce or trace the null estimated_cost_cents_min case and review how other possibly omitted fields are handled. Done means a response with null or omitted cost fields no longer crashes the button.

Written by the indexing model from the issue text.

Description

We're getting a crash in the SeatGeek app due to the LyftButton failing to set the cost on the button as a result its API request for cost estimates, with this field (and presumably others it can't reach) being null or omitted from the response.

Stack trace:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
       at com.lyft.lyftbutton.LyftButton.displayCost(LyftButton.java:191)
       at com.lyft.lyftbutton.LyftButton.access$300(LyftButton.java:21)
       at com.lyft.lyftbutton.LyftButton$2.onSuccess(LyftButton.java:160)
       at com.lyft.lyftbutton.LyftButtonCallManager$4.onResponse(LyftButtonCallManager.java:184)
       at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0(DefaultCallAdapterFactory.java:89)
       at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1.lambda$onResponse$0$DefaultCallAdapterFactory$ExecutorCallbackCall$1(DefaultCallAdapterFactory.java:3)
       at retrofit2.-$$Lambda$DefaultCallAdapterFactory$ExecutorCallbackCall$1$hVGjmafRi6VitDIrPNdoFizVAdk.run(-.java:3)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:246)
       at android.app.ActivityThread.main(ActivityThread.java:8595)
Dominant language
Java
Stars
72
Forks
21
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lyft/lyft-android-sdk

All issues in lyft/lyft-android-sdk

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.