the-blue-alliance / the-blue-alliance-android

An Android app for accessing information about the FIRST Robotics Competition.
MIT License
78 stars 35 forks source link

Fix for crash when viewing team@event for a B team #976

Closed bherbst closed 10 months ago

bherbst commented 1 year ago

Summary:

When trying to view a Team@Event page for a B team, the app crashes with

Caused by: java.lang.NumberFormatException: For input string: "114B"
  at java.lang.Integer.parseInt(Integer.java:797)
  at java.lang.Integer.parseInt(Integer.java:915)
  at com.thebluealliance.androidclient.helpers.TeamHelper.getTeamNumber(TeamHelper.java:61)

Easy steps to reproduce:

  1. Go to the 2023 Madtown Throwdown event page (Nov 10-12, 2023)
  2. Go to the rankings tab
  3. Expand 114B's rankings
  4. Click "more"
  5. 💣 💥

To fix this we just need to adjust our getTeamNumber() logic to properly extract team numbers for B teams.

Test Plan: New unit test assertions for B teams, and confirmed the previously broken flow now works.

Screenshots: The summary tab isn't great, but the matches tab works! Matches Summary
114b_matches 114_b_summary