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

fix: add null protection for locations field #800

Merged
merged 1 commit into from
Nov 6, 2024
Merged

Conversation

davidgamez
Copy link
Member

Summary:

Fix #799

Expected behavior:

Having null values in locations don't crash the app.

Testing tips:

Follow steps in #799

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

Copy link

github-actions bot commented Nov 6, 2024

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-800-ldokw9n4.web.app

@davidgamez
Copy link
Member Author

Screenshot 2024-11-06 at 1 49 22 PM

@davidgamez davidgamez merged commit 77b7811 into main Nov 6, 2024
4 checks passed
@davidgamez davidgamez deleted the fix/location-null branch November 6, 2024 18:52
@jcpitre
Copy link
Contributor

jcpitre commented Dec 10, 2024

@davidgamez I think we need to go around and correct other cases where this happens. e.g. :

{feed?.data_type === 'gtfs' &&

We get an NPE and a white page when trying to display the summary for tld-933

): string {
if (locations === undefined) {
if (locations === undefined || locations === null) {
Copy link
Contributor

@jcpitre jcpitre Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we use locations == null to cover both cases? Why do we use a strict equality operator?
(I know its been closed for a while, but I suspect we'll have similar repairs to do. e.g. this comment)

@isabelle-dr
Copy link

Also a blank page for https://mobilitydatabase.org/feeds/tld-823

@isabelle-dr
Copy link

@emmambd
Copy link
Contributor

emmambd commented Dec 11, 2024

@isabelle-dr It's because you're logged in as a mobilitydata user. It's not a user facing issue - those are unpublished feeds. I can give you an overview of how this new workflow operates on Friday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Searching motionbuscard causes a blank screen and breaks further searches
5 participants